[PATCH 13/19] present: Add driver facing window flip mode hooks

Adam Jackson ajax at nwnk.net
Mon Jan 29 18:08:47 UTC 2018


On Mon, 2018-01-29 at 14:34 +0100, Roman Gilg wrote:

> @@ -100,6 +128,21 @@ typedef struct present_screen_info {
>  
>  } present_screen_info_rec, *present_screen_info_ptr;
>  
> +typedef struct present_wnmd_info {
> +    uint32_t                            version;
> +
> +    present_get_crtc_ptr                get_crtc;
> +    present_wnmd_get_ust_msc_ptr        get_ust_msc;
> +    present_wnmd_queue_vblank_ptr       queue_vblank;
> +    present_wnmd_abort_vblank_ptr       abort_vblank;
> +    present_flush_ptr                   flush;
> +    uint32_t                            capabilities;
> +    present_check_flip_ptr              check_flip;
> +    present_wnmd_flip_ptr               flip;
> +    present_wnmd_unflip_ptr             unflip;
> +
> +} present_wnmd_info_rec, *present_wnmd_info_ptr;

I'm not a huge fan of this. present_screen_info is versioned for
exactly this reason, if we want to add new functionality we bump the
'version' field and add new function pointers to the end of the vtable.

The mode-dependent bit of present_destroy_window would admittedly be a
bit awkward to add to this table, since it's the driver that would fill
it in. It might be nice to refactor that path so even the screen-mode
code tracked flips per-window (and just only ever _did_ any on the root
window). Which, tbh, might not be a bad idea in general: add a
check_flip_window to present_screen_info, and for the "screen mode"
code just fail if the window isn't the root.

- ajax


More information about the xorg-devel mailing list