<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 27, 2018 at 8:32 AM, Leo Liu <span dir="ltr"><<a href="mailto:leo.liu@amd.com" target="_blank">leo.liu@amd.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The blit here involves scaling since it's copying from I8 format to R8G8 format.<br>
Half of source will be filtered out with PIPE_TEX_FILTER_NEAREST instruction, it<br>
looks that GPU always uses the second half as source. Currently we use "1" as<br>
the start point of x for R, then causing 1 source pixel of U component shift to<br>
right. So "-1" should be the start point for U component.<br>
<br>
Cc: 18.0 18.1 <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
---<br>
src/gallium/state_trackers/<wbr>omx/vid_enc_common.c | 8 ++++----<br>
1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/gallium/state_trackers/<wbr>omx/vid_enc_common.c b/src/gallium/state_trackers/<wbr>omx/vid_enc_common.c<br>
index 874dd3a..2aa739d 100644<br>
--- a/src/gallium/state_trackers/<wbr>omx/vid_enc_common.c<br>
+++ b/src/gallium/state_trackers/<wbr>omx/vid_enc_common.c<br>
@@ -353,7 +353,7 @@ OMX_ERRORTYPE enc_LoadImage_common(vid_enc_<wbr>PrivateType * priv, OMX_VIDEO_PORTDEF<br>
blit.src.resource = inp->resource;<br>
blit.src.format = inp->resource->format;<br>
<br>
- blit.src.box.x = 0;<br>
+ blit.src.box.x = -1;<br>
blit.src.box.y = def->nFrameHeight;<br>
blit.src.box.width = def->nFrameWidth;<br>
blit.src.box.height = def->nFrameHeight / 2 ;<br>
@@ -367,11 +367,11 @@ OMX_ERRORTYPE enc_LoadImage_common(vid_enc_<wbr>PrivateType * priv, OMX_VIDEO_PORTDEF<br>
blit.dst.box.depth = 1;<br>
blit.filter = PIPE_TEX_FILTER_NEAREST;<br>
<br>
- blit.mask = PIPE_MASK_G;<br>
+ blit.mask = PIPE_MASK_R;<br>
priv->s_pipe->blit(priv->s_<wbr>pipe, &blit);<br>
<br>
- blit.src.box.x = 1;<br>
- blit.mask = PIPE_MASK_R;<br>
+ blit.src.box.x = 0;<br>
+ blit.mask = PIPE_MASK_G;<br>
priv->s_pipe->blit(priv->s_<wbr>pipe, &blit);<br>
priv->s_pipe->flush(priv->s_<wbr>pipe, NULL, 0);<br>
<span class="HOEnZb"><font color="#888888"> <br>
-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>