<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 7, 2018, 4:59 AM Lucas Stach <<a href="mailto:l.stach@pengutronix.de">l.stach@pengutronix.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marek,<br>
<br>
thanks for the review.<br>
<br>
Am Samstag, den 26.05.2018, 00:36 -0400 schrieb Marek Olšák:<br>
[...]<br>
> <br>
> > @@ -983,7 +760,7 @@ dri2_update_tex_buffer(struct dri_drawable *drawable,<br>
> > <br>
> > static __DRIimage *<br>
> > dri2_create_image_from_winsys(__DRIscreen *_screen,<br>
> > - int width, int height, int format,<br>
> > + int width, int height, enum pipe_format pf,<br>
> > int num_handles, struct winsys_handle *whandle,<br>
> > void *loaderPrivate)<br>
> > {<br>
> > @@ -992,13 +769,8 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,<br>
> > __DRIimage *img;<br>
> > struct pipe_resource templ;<br>
> > unsigned tex_usage = 0;<br>
> > - enum pipe_format pf;<br>
> > int i;<br>
> > <br>
> > - pf = dri2_format_to_pipe_format (format);<br>
> > - if (pf == PIPE_FORMAT_NONE)<br>
> > - return NULL;<br>
> > -<br>
> > if (pscreen->is_format_supported(pscreen, pf, screen->target, 0,<br>
> > PIPE_BIND_RENDER_TARGET))<br>
> > tex_usage |= PIPE_BIND_RENDER_TARGET;<br>
> > @@ -1006,6 +778,20 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,<br>
> > PIPE_BIND_SAMPLER_VIEW))<br>
> > tex_usage |= PIPE_BIND_SAMPLER_VIEW;<br>
> > <br>
> > + if (!tex_usage && util_format_is_yuv(pf)) {<br>
> > + /* YUV format sampling can be emulated by the Mesa state tracker by<br>
> > + * using multiple R8/RG88 samplers. So try to rewrite the pipe format.<br>
> > + */<br>
> > + pf = PIPE_FORMAT_R8_UNORM;<br>
> > +<br>
> > + if (pscreen->is_format_supported(pscreen, pf, screen->target, 0,<br>
> > + PIPE_BIND_SAMPLER_VIEW))<br>
> > + tex_usage |= PIPE_BIND_SAMPLER_VIEW;<br>
> > + }<br>
> <br>
> This doesn't seem to belong in this commit.<br>
<br>
It does. The removed conversion functions would end up with<br>
PIPE_FORMAT_R8_UNORM for I420 or NV12 input FOURCCs, with the implicit<br>
assumption that all drivers need the emulation by the Mesa state-<br>
tracker.<br>
<br>
The new format table maps those to the proper PIPE_FORMAT_IYUV and<br>
PIPE_FORMAT_NV12, so in order to not break drivers which can't handle<br>
those formats natively and need the Mesa side emulation we need this<br>
hunk of code.<br>
<br>
> Other than that, the series is:<br>
> <br>
> > Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank" rel="noreferrer">marek.olsak@amd.com</a>><br>
<br>
With the above explanation, can I keep your review for the whole patch?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards,<br>
Lucas<br>
</blockquote></div></div></div>