• Ville Syrjälä's avatar
    drm: Introduce plane SIZE_HINTS property · 9677547d
    Ville Syrjälä authored
    Add a new immutable plane property by which a plane can advertise
    a handful of recommended plane sizes. This would be mostly exposed
    by cursor planes as a slightly more capable replacement for
    the DRM_CAP_CURSOR_WIDTH/HEIGHT caps, which can only declare
    a one size fits all limit for the whole device.
    
    Currently eg. amdgpu/i915/nouveau just advertize the max cursor
    size via the cursor size caps. But always using the max sized
    cursor can waste a surprising amount of power, so a better
    strategy is desirable.
    
    Most other drivers don't specify any cursor size at all, in
    which case the ioctl code just claims that 64x64 is a great
    choice. Whether that is actually true is debatable.
    
    A poll of various compositor developers informs us that
    blindly probing with setcursor/atomic ioctl to determine
    suitable cursor sizes is not acceptable, thus the
    introduction of the new property to supplant the cursor
    size caps. The compositor will now be free to select a
    more optimal cursor size from the short list of options.
    
    Note that the reported sizes (either via the property or the
    caps) make no claims about things such as plane scaling. So
    these things should only really be consulted for simple
    "cursor like" use cases.
    
    Userspace consumer in the form of mutter seems ready:
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3165
    
    v2: Try to add some docs
    v3: Specify that value 0 is reserved for future use (basic idea from Jonas)
        Drop the note about typical hardware (Pekka)
    v4: Update the docs to indicate the list is "in order of preference"
        Add a a link to the mutter MR
    v5: Limit to cursors only for now (Simon)
    
    Cc: Jonas Ådahl <jadahl@redhat.com>
    Cc: Sameer Lattannavar <sameer.lattannavar@intel.com>
    Reviewed-by: default avatarSebastian Wick <sebastian.wick@redhat.com>
    Reviewed-by: default avatarSimon Ser <contact@emersion.fr>
    Acked-by: default avatarDaniel Stone <daniels@collabora.com>
    Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
    Acked-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240318204408.9687-2-ville.syrjala@linux.intel.com
    9677547d
drm_plane.h 31.1 KB