[PATCH xserver 2/2] modesetting: Fix reported size when using atomic modesetting

Olivier Fourdan ofourdan at redhat.com
Thu Mar 29 07:46:54 UTC 2018


On Thu, Mar 29, 2018 at 7:07 AM, Louis-Francis Ratté-Boulianne <
lfrb at collabora.com> wrote:

> The framebuffer can include multiple CRTCs in multi-monitors
> setup. So we shouldn't use the buffer size but the CRTC size
> instead. Rotated displays are shadowed, so we don't need to
> worry about it there.
>
> Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index e010eae21..a70b4c6b4 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -562,15 +562,15 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc,
> DisplayModePtr mode, uint32_t fb_id,
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x
> << 16);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y
> << 16);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W,
> -                              drmmode->front_bo.width << 16);
> +                              crtc->mode.HDisplay << 16);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H,
> -                              drmmode->front_bo.height << 16);
> +                              crtc->mode.VDisplay << 16);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W,
> -                              drmmode->front_bo.width);
> +                              crtc->mode.HDisplay);
>          ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H,
> -                              drmmode->front_bo.height);
> +                              crtc->mode.VDisplay);
>
>          if (ret == 0)
>              ret = drmModeAtomicCommit(ms->fd, req, flags, data);
> --
> 2.14.3
>


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...

So, it also requires https://patchwork.freedesktop.org/series/40860/ and
with this, this patch is:

Tested-by: Olivier Fourdan <ofourdan at redhat.com>
Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

Cheers,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180329/ad6b3b35/attachment.html>


More information about the xorg-devel mailing list