Re: [PATCH xserver] modesetting: Honor xorg.conf for 16bpp

2017-03-23 Thread Adam Jackson
On Thu, 2017-03-23 at 11:20 +0200, Alkis Georgopoulos wrote:
> On 23/03/2017 11:00 πμ, Timo Aaltonen wrote:
> > 'xinit -- -depth 16' still doesn't work, but xorg.conf does.
> > 
> 
> I verify this on kvm/cirrus/modeset and on vbox/vboxvideo/modeset.
> It also fixes the crash on Intel broadwell with modesetting!
> 
> But without a xorg.conf, i.e. with `xinit -- -depth 16`, everything is 
> still broken.

Ugh, yeah. The issue there is the command line options aren't directly
visible to the drivers. I'll see if I can work something out.

- ajax
___
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

Re: [PATCH xserver] modesetting: Honor xorg.conf for 16bpp

2017-03-23 Thread Alkis Georgopoulos

On 23/03/2017 11:00 πμ, Timo Aaltonen wrote:

'xinit -- -depth 16' still doesn't work, but xorg.conf does.



I verify this on kvm/cirrus/modeset and on vbox/vboxvideo/modeset.
It also fixes the crash on Intel broadwell with modesetting!

But without a xorg.conf, i.e. with `xinit -- -depth 16`, everything is 
still broken.

___
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

Re: [PATCH xserver] modesetting: Honor xorg.conf for 16bpp

2017-03-23 Thread Timo Aaltonen
On 21.03.2017 21: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 

'xinit -- -depth 16' still doesn't work, but xorg.conf does.


-- 
t
___
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

Re: [PATCH xserver] modesetting: Honor xorg.conf for 16bpp

2017-03-22 Thread Hans de Goede

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