[RFC xserver v4 04/14] present: Send PresentCompleteModeSuboptimalCopy appropriately

Michel Dänzer michel at daenzer.net
Tue Oct 17 16:16:13 UTC 2017


On 16/10/17 07:02 AM, Louis-Francis Ratté-Boulianne wrote:
> Add 'check_flip2' hook for driver to let know the core
> about why flipping is not possible ('reason').
> If it is because of unsupported buffer format/modifier,
> a PresentCompleteNotify event is sent to the client with
> the PresentCompleteModeSuboptimalCopy mode.
> 
> v4: It replaces the old mechanism for format renegotiation

This is v1 of a new patch, not v4 of an existing patch.


> @@ -177,7 +178,12 @@ present_check_flip(RRCrtcPtr    crtc,
>      }
>  
>      /* Ask the driver for permission */
> -    if (screen_priv->info->check_flip) {
> +    if (screen_priv->info->check_flip2 && reason) {

The check_flip2 field can only be used if (screen_priv->info->version >= 1).


> @@ -564,6 +570,7 @@ present_check_flip_window (WindowPtr window)
>      present_window_priv_ptr     window_priv = present_window_priv(window);
>      present_vblank_ptr          flip_pending = screen_priv->flip_pending;
>      present_vblank_ptr          vblank;
> +    int                         reason = 0;

This variable doesn't really need to be initialized, does it?


> @@ -756,10 +764,14 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
>      /* Compute correct CompleteMode
>       */
>      if (vblank->kind == PresentCompleteKindPixmap) {
> -        if (vblank->pixmap && vblank->window)
> -            mode = PresentCompleteModeCopy;
> -        else
> +        if (vblank->pixmap && vblank->window) {
> +            if (vblank->reason == PresentFlipReasonBufferFormat)
> +                mode = PresentCompleteModeSuboptimalCopy;

Setting PresentCompleteModeSuboptimalCopy will break clients which don't
know about it. There needs to be some kind of handshake to know that the
client can handle it. E.g. via a new PresentOption, or via the minor
version passed in by the client in the PresentQueryVersion request.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer



More information about the xorg-devel mailing list