title: Working with SDL on Hisilicon - Hi3516
body: <p>I'm trying to use SDL library on my Hi3516 chip.</p>
  
  <p>I'm able to compile my code (after setting the SDL config to <code>arm-hisiv300-linux-gcc</code>).</p>
  
  <p>My code is:</p>
  
  <pre><code>int main(int argc, char *argv[]){
      SDL_Surface *screen;
      SDL_Event event;
  
      int keypress = 0;
      int h=0; 
      setenv("SDL_FBDEV", "/dev/fb0", 1);
      setenv("SDL_VIDEODRIVER", "fbcon", 1);
      setenv("SDL_MOUSEDEV", "/dev/input/event0", 1);
      if (SDL_Init(SDL_INIT_VIDEO) &lt; 0 ){
          printf("BBB %s\n", SDL_GetError());
          return 1;
      }
      if (!(screen = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, 
          SDL_FULLSCREEN|SDL_HWSURFACE)))
      {
          printf("SDL_SetVideoMode fail\n");
          printf("BBB %s\n", SDL_GetError());
          SDL_Quit();
          return 1;
      }
      printf("SDL_SetVideoMode pass\n");
      SDL_Flip(screen); 
      SDL_Quit();
      return 1;
  }
  </code></pre>
  
  <p>I see a small mouse cursor that moves when I move my mouse but in an not regular way.
  Plus, my screen resolution is 1920x1080 but it only allows me to set it to 640x480.</p>
  
  <p>I can elaborate about my code and my embedded system if anyone can help.</p>
  
  <p>Does someone have a sample code that uses SDL on Hi3516 chip?</p>