[Mesa-dev] [PATCH 1/4] vl/dri3: add 10 bits format support for front buffer
Leo Liu
leo.liu at amd.com
Fri Sep 7 15:35:39 UTC 2018
On 09/07/2018 11:09 AM, Michel Dänzer wrote:
> On 2018-09-07 4:13 p.m., Leo Liu wrote:
>> On 09/07/2018 10:07 AM, Michel Dänzer wrote:
>>> On 2018-09-07 3:55 p.m., Leo Liu wrote:
>>>> Signed-off-by: Leo Liu <leo.liu at amd.com>
>>>>
>>>> diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c
>>>> b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
>>>> index 0233f58441..7ac6924c78 100644
>>>> --- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c
>>>> +++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c
>>>> @@ -503,7 +503,13 @@ dri3_get_front_buffer(struct vl_dri3_screen *scrn)
>>>> whandle.stride = bp_reply->stride;
>>>> memset(&templ, 0, sizeof(templ));
>>>> templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
>>>> - templ.format = PIPE_FORMAT_B8G8R8X8_UNORM;
>>>> + if (bp_reply->depth == 24)
>>>> + templ.format = PIPE_FORMAT_B8G8R8X8_UNORM;
>>>> + else if (bp_reply->depth == 30)
>>>> + templ.format = PIPE_FORMAT_B10G10R10X2_UNORM;
>>>> + else
>>>> + goto free_reply;
>>>> +
>>>> templ.target = PIPE_TEXTURE_2D;
>>>> templ.last_level = 0;
>>>> templ.width0 = bp_reply->width;
>>>>
>>> For this patch and patch 4, it's not that simple unfortunately. See e.g.
>>> src/egl/drivers/dri2/platform_x11.c:dri2_format_for_depth().
>> Thanks Michel, I will have a look at this.
>>
>> BTW: I sent one patch yesterday for DRI3 back buffer case, could you
>> take a look as well?
>> [PATCH] vl/dri3: add support for 10 bits format
> Looks like the same issue applies there as well. Maybe you can include
> its next revision in this series.
Yeah.
>
> BTW, it occurred to me that patch 3 could set vlsurface->send_to_X to
> true for dev->vscreen->color_depth == 30 as well, if rgba_format matches
> the X server's depth 30 format.
Right in theory. But I have tried with mpv(Ubuntu 18.04)/vdpau, it won't
work as expected, because with 10bit videos and 10 bits display, mpv
still ask "VDP_RGBA_FORMAT_B8G8R8A8" for allocating output buffer here
instead of asking VDP_RGBA_FORMAT_B10G10R10A2 format, so rgba_format
from player is not matching X server 30 bits depth.
Regards,
Leo
> But that could be done in a follow-up patch.
>
>
More information about the mesa-dev
mailing list