xserver/hw/xfree86/drivers/modesetting
Ville Syrjälä 1f41320e1c modesetting: Use a more optimal hw cursor size
Try to minimize the used hw cursor size in order to
minimize power consumption. There is no kernel query
for the minimum so we'll just probe around with
setcursor2 (using an invisible cursor image so
there will be no visual artifacts).

To avoid having to deal with absolutely every size stick
to power-of-two numbers. And with a bit of extra effort
we can determine whether non-square dimesions will also
work, which they do to some degree on current Intel GPUs.

On my Alderlake laptop I'm seeing a massive (up to .5W)
difference in power consumption between 64x64 vs. 256x256
cursors. While some of that is undoubtedly something that
needs to be fixed in i915's display data buffer allocation
code, it still makes sense to use as small as possible
cursor to minimize the wastege.

In case the crtc is rotated just punt to the max cursor size
for now since midlayer has already done the coordinate
transformations based on that. To make smaller cursors work
with rotation we'd either need to make the midlayer(s) aware
of the final cursor size, or just handle the whole roation
business in modesetting. I suspect the latter option would
be easier.

v2: Only allow square cursors in most cases for now as eg.
    on modern Intel hardware non-square only works with
    wide+short but not with narrow+tall cursors. Non-square
    size may still be used when maximum limits aren't
    square and the squared+POT'd dimensions would exceed
    one of the max limits.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2023-12-16 08:03:26 +02:00
..
dri2.c modesetting: Pass reference CRTC pointer to ms_do_pageflip 2023-02-28 22:43:37 -08:00
driver.c modesetting: Use a more optimal hw cursor size 2023-12-16 08:03:26 +02:00
driver.h modesetting: Use a more optimal hw cursor size 2023-12-16 08:03:26 +02:00
drmmode_display.c modesetting: Use a more optimal hw cursor size 2023-12-16 08:03:26 +02:00
drmmode_display.h modesetting: Use a more optimal hw cursor size 2023-12-16 08:03:26 +02:00
dumb_bo.c modesetting: Include dix-config.h from dumb_bo.c 2015-05-12 08:02:11 -07:00
dumb_bo.h modesetting: Drop dumb_bo::map_count field and dead unmap code. 2014-12-11 11:26:19 -08:00
meson.build xfree86: Link fb statically 2019-07-23 14:24:00 -04:00
modesetting.man modesetting: Document the "Atomic" option 2022-12-20 10:10:59 +01:00
pageflip.c modesetting: unflip before any setcrtc() calls 2023-12-16 04:36:39 +00:00
present.c modesetting: unflip before any setcrtc() calls 2023-12-16 04:36:39 +00:00
vblank.c modesetting: unflip before any setcrtc() calls 2023-12-16 04:36:39 +00:00