summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 14:34:56 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-01-25 14:34:56 +0200
commit47a04d40f35a02a64f8410ee684affc5f0af894f (patch)
treea32a4f9d4901a6a1ca1a8a763627cd795ab5fb3d /libvo
parentffc3db22395b2a505e2f9ef6e805650c9b375731 (diff)
parenta91c19964de606c8002531cbb87aa6de3d89508f (diff)
downloadmpv-47a04d40f35a02a64f8410ee684affc5f0af894f.tar.bz2
mpv-47a04d40f35a02a64f8410ee684affc5f0af894f.tar.xz
Merge svn changes up to r30250
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_fbdev.c13
-rw-r--r--libvo/vo_fbdev2.c8
2 files changed, 15 insertions, 6 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index 12700108aa..96a173938c 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);
diff --git a/libvo/vo_fbdev2.c b/libvo/vo_fbdev2.c
index a2b51debde..c44a216b75 100644
--- a/libvo/vo_fbdev2.c
+++ b/libvo/vo_fbdev2.c
@@ -319,13 +319,17 @@ static int query_format(uint32_t format)
set_bpp(&fb_vinfo, fb_target_bpp);
fb_vinfo.xres_virtual = fb_vinfo.xres;
fb_vinfo.yres_virtual = fb_vinfo.yres;
+ if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo))
+ // Needed for Intel framebuffer with 32 bpp
+ fb_vinfo.transp.length = fb_vinfo.transp.offset = 0;
if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) {
mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't put VSCREENINFO: %s\n", strerror(errno));
return 0;
}
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 == fb_target_bpp)
return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE;
}