diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-09 11:26:39 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-01-09 11:26:39 +0000 |
commit | 52e2d23da6884de67df8ae41a75906ae7196094b (patch) | |
tree | d5ce8f5a265a322d1b21911e15d951b6c1c71a08 /libvo/vo_fbdev.c | |
parent | 0a411a89e9d43833385afcf7d4aa500fa74c0c95 (diff) | |
download | mpv-52e2d23da6884de67df8ae41a75906ae7196094b.tar.bz2 mpv-52e2d23da6884de67df8ae41a75906ae7196094b.tar.xz |
Fix vo_fbdev to also work with Intel framebuffer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30248 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_fbdev.c')
-rw-r--r-- | libvo/vo_fbdev.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c index 24870a3c96..c3341858c2 100644 --- a/libvo/vo_fbdev.c +++ b/libvo/vo_fbdev.c @@ -692,8 +692,9 @@ static int fb_preinit(int reset) mp_msg(MSGT_VO, MSGL_ERR, "notice: Can't open /dev/tty: %s\n", strerror(errno)); } - fb_bpp = fb_vinfo.red.length + fb_vinfo.green.length + - fb_vinfo.blue.length + fb_vinfo.transp.length; + fb_bpp = fb_vinfo.bits_per_pixel; + if (fb_bpp == 16) + fb_bpp = fb_vinfo.red.length + fb_vinfo.green.length + fb_vinfo.blue.length; if (fb_bpp == 8 && !vo_dbpp) { mp_msg(MSGT_VO, MSGL_ERR, "8 bpp output is not supported.\n"); @@ -811,6 +812,9 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, fb_tty_fd = -1; } + if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) + // Intel drivers fail if we request a transparency channel + fb_vinfo.transp.length = fb_vinfo.transp.offset = 0; if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) { mp_msg(MSGT_VO, MSGL_ERR, "Can't put VSCREENINFO: %s\n", strerror(errno)); if (fb_tty_fd >= 0 && ioctl(fb_tty_fd, KDSETMODE, KD_TEXT) < 0) { @@ -820,8 +824,9 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, } fb_pixel_size = fb_vinfo.bits_per_pixel / 8; - fb_bpp = fb_vinfo.red.length + fb_vinfo.green.length + - fb_vinfo.blue.length + fb_vinfo.transp.length; + fb_bpp = fb_vinfo.bits_per_pixel; + if (fb_bpp == 16) + fb_bpp = fb_vinfo.red.length + fb_vinfo.green.length + fb_vinfo.blue.length; if (fb_bpp_we_want != fb_bpp) mp_msg(MSGT_VO, MSGL_WARN, "requested %d bpp, got %d bpp!!!\n", fb_bpp_we_want, fb_bpp); |