<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 28, 2014 at 6:15 PM, Fabien DESSENNE <span dir="ltr"><<a href="mailto:fabien.dessenne@st.com" target="_blank">fabien.dessenne@st.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This fixes an issue where the DRM planes do not support the same pixel<br>
formats.<br>
The current implementation selects a DRM plane without checking whether<br>
the pixel format is supported or not. As a consequence modetest may try<br>
to set up a plane not supporting the user request-format, which fails.<br>
Modetest has to check the supported formats accross the plane list before<br>
selecting a candidate.<br>
<br>
Signed-off-by: Fabien Dessenne <<a href="mailto:fabien.dessenne@st.com" target="_blank">fabien.dessenne@st.com</a>><br>
---<br>
tests/modetest/modetest.c | 9 ++++++---<br>
1 file changed, 6 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c<br>
index 4761c60..866ea82 100644<br>
--- a/tests/modetest/modetest.c<br>
+++ b/tests/modetest/modetest.c<br>
@@ -951,7 +951,7 @@ static int set_plane(struct device *dev, struct plane_arg *p)<br>
int crtc_x, crtc_y, crtc_w, crtc_h;<br>
struct crtc *crtc = NULL;<br>
unsigned int pipe;<br>
- unsigned int i;<br>
+ unsigned int i, j;<br>
<br>
/* Find an unused plane which can be connected to our CRTC. Find the<br>
* CRTC index first, then iterate over available planes.<br>
@@ -974,8 +974,11 @@ static int set_plane(struct device *dev, struct plane_arg *p)<br>
if (!ovr)<br>
continue;<br>
<br>
- if ((ovr->possible_crtcs & (1 << pipe)) && !ovr->crtc_id)<br>
- plane_id = ovr->plane_id;<br>
+ if ((ovr->possible_crtcs & (1 << pipe)) && !ovr->crtc_id) {<br>
+ for (j = 0; j < ovr->count_formats; j++)<br>
+ if (!strncmp(p->format_str, (char *) &ovr->formats[j], 4))<br>
+ plane_id = ovr->plane_id;<br>
+ }<br></blockquote><div><br></div><div>This loop continues to cycle through the list even after a positive match.</div><div>A micro-optimization would be to add a "break;" after setting plane_id.</div>
<div>Either way, this patch is:<br></div><div><br>Reviewed-by: Daniel Kurtz <<a href="mailto:djkurtz@chromium.org" target="_blank">djkurtz@chromium.org</a>></div><div><br></div><div>But, I can't help you get the patch actually committed to the DRM repository...</div>
<div>I'm still trying to get someone to help me get my own patches in.</div><div><br></div><div>Best Regards,</div><div>-djk</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
if (!plane_id) {<br>
<span><font color="#888888">--<br>
1.9.0<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br></div></div>