<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 29, 2018 at 7:07 AM, Louis-Francis Ratté-Boulianne <span dir="ltr"><<a href="mailto:lfrb@collabora.com" target="_blank">lfrb@collabora.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">The framebuffer can include multiple CRTCs in multi-monitors<br>
setup. So we shouldn't use the buffer size but the CRTC size<br>
instead. Rotated displays are shadowed, so we don't need to<br>
worry about it there.<br>
<br>
Signed-off-by: Louis-Francis Ratté-Boulianne <<a href="mailto:lfrb@collabora.com">lfrb@collabora.com</a>><br>
---<br>
 hw/xfree86/drivers/<wbr>modesetting/drmmode_display.c | 8 ++++----<br>
 1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/hw/xfree86/drivers/<wbr>modesetting/drmmode_display.c b/hw/xfree86/drivers/<wbr>modesetting/drmmode_display.c<br>
index e010eae21..a70b4c6b4 100644<br>
--- a/hw/xfree86/drivers/<wbr>modesetting/drmmode_display.c<br>
+++ b/hw/xfree86/drivers/<wbr>modesetting/drmmode_display.c<br>
@@ -562,15 +562,15 @@ drmmode_crtc_set_fb(<wbr>xf86CrtcPtr crtc, DisplayModePtr mode, uint32_t fb_id,<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x << 16);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y << 16);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W,<br>
-                              drmmode->front_bo.width << 16);<br>
+                              crtc->mode.HDisplay << 16);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H,<br>
-                              drmmode->front_bo.height << 16);<br>
+                              crtc->mode.VDisplay << 16);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W,<br>
-                              drmmode->front_bo.width);<br>
+                              crtc->mode.HDisplay);<br>
         ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H,<br>
-                              drmmode->front_bo.height);<br>
+                              crtc->mode.VDisplay);<br>
<br>
         if (ret == 0)<br>
             ret = drmModeAtomicCommit(ms->fd, req, flags, data);<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.14.3</font></span><br></blockquote></div><br><br><div class="gmail_extra">Looks good to me *but* this is not sufficient because do_queue_flip_on_crtc() calls drmmode_crtc_set_fb() with (x=0,y=0) for any CRTC regardless of its actual location...<br><br></div><div class="gmail_extra">So, it also requires <a href="https://patchwork.freedesktop.org/series/40860/">https://patchwork.freedesktop.org/series/40860/</a> and with this, this patch is:<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Tested-by: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com" target="_blank">ofourdan@redhat.com</a>><br></div><div class="gmail_extra">Reviewed-by: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com" target="_blank">ofourdan@redhat.com</a>></div><br></div><div class="gmail_extra">Cheers,<br></div><div class="gmail_extra">Olivier<br></div></div>