[PATCH xf86-video-amdgpu 7/7] present: Separate checks for flips vs unflips

Alex Deucher alexdeucher at gmail.com
Wed Jun 22 16:52:06 UTC 2016


On Wed, Jun 22, 2016 at 4:50 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> All unflip checks apply to flips as well, but not vice versa.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  src/amdgpu_present.c | 43 +++++++++++++++++++++++++------------------
>  1 file changed, 25 insertions(+), 18 deletions(-)
>
> diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
> index c0b2f17..b0ee580 100644
> --- a/src/amdgpu_present.c
> +++ b/src/amdgpu_present.c
> @@ -210,16 +210,9 @@ amdgpu_present_flush(WindowPtr window)
>         amdgpu_glamor_flush(xf86ScreenToScrn(window->drawable.pScreen));
>  }
>
> -/*
> - * Test to see if page flipping is possible on the target crtc
> - */
>  static Bool
> -amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
> -                         Bool sync_flip)
> +amdgpu_present_check_unflip(ScrnInfoPtr scrn)
>  {
> -       ScreenPtr screen = window->drawable.pScreen;
> -       ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> -       AMDGPUInfoPtr info = AMDGPUPTR(scrn);
>         xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
>         int num_crtcs_on;
>         int i;
> @@ -227,15 +220,6 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
>         if (!scrn->vtSema)
>                 return FALSE;
>
> -       if (!info->allowPageFlip)
> -               return FALSE;
> -
> -       if (info->hwcursor_disabled)
> -               return FALSE;
> -
> -       if (info->drmmode.dri2_flipping)
> -               return FALSE;
> -
>         for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) {
>                 drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private;
>
> @@ -254,6 +238,29 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
>  }
>
>  /*
> + * Test to see if page flipping is possible on the target crtc
> + */
> +static Bool
> +amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
> +                         Bool sync_flip)
> +{
> +       ScreenPtr screen = window->drawable.pScreen;
> +       ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
> +       AMDGPUInfoPtr info = AMDGPUPTR(scrn);
> +
> +       if (!info->allowPageFlip)
> +               return FALSE;
> +
> +       if (info->hwcursor_disabled)
> +               return FALSE;
> +
> +       if (info->drmmode.dri2_flipping)
> +               return FALSE;
> +
> +       return amdgpu_present_check_unflip(scrn);

Maybe add a comment as per your commit message above the unflip check
to make it clear why we calling unflip from the flip function.  Either
way:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> +}
> +
> +/*
>   * Once the flip has been completed on all CRTCs, notify the
>   * extension code telling it when that happened
>   */
> @@ -333,7 +340,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
>         PixmapPtr pixmap = screen->GetScreenPixmap(screen);
>         int i;
>
> -       if (!amdgpu_present_check_flip(NULL, screen->root, pixmap, TRUE))
> +       if (!amdgpu_present_check_unflip(scrn))
>                 goto modeset;
>
>         event = calloc(1, sizeof(struct amdgpu_present_vblank_event));
> --
> 2.8.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list