<div dir="ltr">Hi<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 21, 2018 at 10:09 PM, Mario Kleiner <span dir="ltr"><<a href="mailto:mario.kleiner.de@gmail.com" target="_blank">mario.kleiner.de@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks. However, seems we may have one more problem with the new code<br>
on slightly older < gen 9 Intel hw. Either that, or something is<br>
botched on my system atm., after pulling in all kind of updates to<br>
xorg-proto and xcb-proto and libdrm and stuff to make the server and<br>
mesa compile again.<br>
<br>
Using x-server/mesa master from last friday plus my patch, everything<br>
was fine when testing on radeon-kms and nouveau-kms, but when i tested<br>
on Intel IvyBridge (gen 5), i stared at a blank screen. Xorg log<br>
reported modeset failure with EINVAL iirc, the kernel at drm.debug<br>
level 1 reported:<br>
<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235103]<br>
[drm:drm_atomic_set_mode_prop_<wbr>for_crtc [drm]] Set [MODE:] for CRTC<br>
state ffff9496185e3000<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235112]<br>
[drm:drm_mode_object_put [drm]] OBJ ID: 81 (4)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235122]<br>
[drm:drm_mode_object_put [drm]] OBJ ID: 81 (3)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235133]<br>
[drm:drm_mode_object_get [drm]] OBJ ID: 50 (5)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235142]<br>
[drm:drm_mode_object_get [drm]] OBJ ID: 50 (6)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235152]<br>
[drm:drm_atomic_get_connector_<wbr>state [drm]] Added<br>
[CONNECTOR:50:HDMI-A-1] ffff9495e9629c00 state to ffff94961bb27400<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235162]<br>
[drm:drm_mode_object_put [drm]] OBJ ID: 50 (7)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235171]<br>
[drm:drm_atomic_check_only [drm]] checking ffff94961bb27400<br>
<br>
HERE --><br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235181]<br>
[drm:drm_atomic_check_only [drm]] Invalid pixel format AR24<br>
little-endian (0x34325241)<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235189]<br>
[drm:drm_atomic_check_only [drm]] [PLANE:26:primary A] atomic core<br>
check failed<br>
Mar 16 19:30:48 kleinerm-MaxtorLinux kernel: [  576.235198]<br>
[drm:drm_atomic_state_default_<wbr>clear [drm]] Clearing atomic state<br>
ffff94961bb27400<br>
<br>
This makes sense, as looking at i915-kms, Intel hw before Skylake does<br>
not support setting ARGB pixel formats, only Skylake and later do.<br>
Iirc radeon/amdgpu/nouveau-kms treat ARGB formats like XRGB formats,<br>
so they are nominally supported, even if ARGB is simply mapped to XRGB<br>
hw programming for scanout on some hw.<br>
<br>
In modesetting ddx, we create gbm buffers as either ARGB8888 or<br>
ARGB2101010, not checking if hw supports this. When using the new<br>
drmAddFB2WithModifiers ioctl, we choose format to be whatever the gbm<br>
buffers format is, so that might end badly. When i tried the obvious<br>
hack of switching to depth 24 -> XRGB8888 and depth 30 -> XRGB2101010<br>
i gbm buffer creation, that made modesetting work again at depth 24,<br>
but now broke pageflipping again. For depth 30 it died somewhere deep<br>
in pixman during server startup.<br>
<br>
Looking at the current code in glamor and modesetting ddx, using<br>
XRGB8888 and XRGB2101010 consistently for depth 24 or depth 30 would<br>
actually make more sense to me than ARGB8888 and ARGB2101010, but<br>
hacking that in didn't immediately improve the situation.<br>
<br>
That was the point when i decided it is weekend.<br>
<br>
Maybe we need some fallback mapping of gbm formats to xrgb fallback<br>
pixel formats, just for the code path of drmAddFB2WithModifiers,<br>
similar to what we do in weston for the direct scanout path? Create<br>
buffers in ARGB, but submit them as XRGB for scanout?<br></blockquote><div><br></div><div>Yeap, I ended up at the same point in downstream bug <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1558476">https://bugzilla.redhat.com/show_bug.cgi?id=1558476</a>, yet using XRGB8888 instead of ARGB8888 fixes the issue reliably here...<br><br></div><div>Cheers,<br></div><div>Olivier<br></div></div></div></div>