[PATCH xserver 2/2] modesetting: Only add main fb if necessary

Dave Airlie airlied at gmail.com
Tue Jun 14 05:11:32 UTC 2016


These two are

Reviewed-by: Dave Airlie <airlied at redhat.com>

Can you take a look at Lyude's patch just posted? not sure if it'll
conflict with these.

Dave.

On 2 June 2016 at 05:04, Hans de Goede <hdegoede at redhat.com> wrote:
> If we're doing reverse-prime; or doing rotation the main fb is not used,
> and there is no reason to add it in this case.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 34 ++++++++++++------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index 2fe46e9..9eb21e2 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -408,24 +408,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
>      int output_count = 0;
>      Bool ret = TRUE;
>      int i;
> -    uint32_t fb_id;
> +    uint32_t fb_id = 0;
>      drmModeModeInfo kmode;
> -    int height;
> -
> -    height = pScrn->virtualY;
> -
> -    if (drmmode->fb_id == 0) {
> -        ret = drmModeAddFB(drmmode->fd,
> -                           pScrn->virtualX, height,
> -                           pScrn->depth, pScrn->bitsPerPixel,
> -                           drmmode_bo_get_pitch(&drmmode->front_bo),
> -                           drmmode_bo_get_handle(&drmmode->front_bo),
> -                           &drmmode->fb_id);
> -        if (ret < 0) {
> -            ErrorF("failed to add fb %d\n", ret);
> -            return FALSE;
> -        }
> -    }
>
>      saved_mode = crtc->mode;
>      saved_x = crtc->x;
> @@ -484,6 +468,22 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
>              fb_id = drmmode_crtc->rotate_fb_id;
>              x = y = 0;
>          }
> +
> +        if (fb_id == 0) {
> +            ret = drmModeAddFB(drmmode->fd,
> +                               pScrn->virtualX, pScrn->virtualY,
> +                               pScrn->depth, pScrn->bitsPerPixel,
> +                               drmmode_bo_get_pitch(&drmmode->front_bo),
> +                               drmmode_bo_get_handle(&drmmode->front_bo),
> +                               &drmmode->fb_id);
> +            if (ret < 0) {
> +                ErrorF("failed to add fb %d\n", ret);
> +                ret = FALSE;
> +                goto done;
> +            }
> +            fb_id = drmmode->fb_id;
> +        }
> +
>          if (drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
>                             fb_id, x, y, output_ids, output_count, &kmode)) {
>              xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
> --
> 2.7.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list