Hi,
On 21-03-17 20:57, Adam Jackson wrote:
The 32->24 support patch messed this up.
Bugzilla: https://bugs.freedesktop.org/100246
Bugzilla: https://bugs.freedesktop.org/100295
Signed-off-by: Adam Jackson
LGTM:
Acked-by: Hans de Goede
Regards,
Hans
---
hw/xfree86/drivers/modesetting/driver.c | 4
hw/xfree86/drivers/modesetting/drmmode_display.c | 6 ++
2 files changed, 10 insertions(+)
diff --git a/hw/xfree86/drivers/modesetting/driver.c
b/hw/xfree86/drivers/modesetting/driver.c
index d7030e5..762b398 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -922,6 +922,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (!check_outputs(ms->fd, _count))
return FALSE;
+defaultdepth = pScrn->confScreen->defaultdepth;
+defaultbpp = pScrn->confScreen->defaultbpp;
drmmode_get_default_bpp(pScrn, >drmmode, , );
if (defaultdepth == 24 && defaultbpp == 24) {
ms->drmmode.force_24_32 = TRUE;
@@ -949,6 +951,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
pScrn->depth);
return FALSE;
}
+if (ms->drmmode.kbpp == 0)
+ms->drmmode.kbpp = pScrn->bitsPerPixel;
xf86PrintDepthBpp(pScrn);
/* Process the options */
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index c1e489e..e6158ab 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2057,6 +2057,8 @@ drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
int cpp)
xf86CrtcConfigInit(pScrn, _xf86crtc_config_funcs);
drmmode->scrn = pScrn;
+if (drmmode->force_24_32 && cpp == 4)
+cpp = 3;
drmmode->cpp = cpp;
mode_res = drmModeGetResources(drmmode->fd);
if (!mode_res)
@@ -2488,6 +2490,10 @@ drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr
drmmode, int *depth,
uint32_t fb_id;
int ret;
+/* if we've been configured in xorg.conf, trust it */
+if (*depth || *bpp)
+return;
+
/* 16 is fine */
ret = drmGetCap(drmmode->fd, DRM_CAP_DUMB_PREFERRED_DEPTH, );
if (!ret && (value == 16 || value == 8)) {
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel