Skip to contentSkip to conversation

drm: Specify a bit more the DRM_CAP_CURSOR_{WIDTH, HEIGHT} caps

PATCH In review Damien Lespiau 3 participants 3 messages Mar 28, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Specify a bit more the DRM_CAP_CURSOR_{WIDTH, HEIGHT} caps

Earlier this week, there was a bit of confusion about those new capabilities, to the point I think it's better to document the intention and API contract.

The comment documents the current situation:
- the radeon driver returns the only valid size for the hw
- i915 returns the maximun cursor size
- other drivers fall back to returning 64x64

The common contract is to return a valid cursor size.

Cc Sagar Kamble <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Imre Deak <[email protected]>
---
 include/uapi/drm/drm.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/uapi/drm/drm.h +9 -0
index b06c8ed..ec6b259 100644
@@ -619,6 +619,15 @@ struct drm_gem_open {
 #define  DRM_PRIME_CAP_EXPORT		0x2
 #define DRM_CAP_TIMESTAMP_MONOTONIC	0x6
 #define DRM_CAP_ASYNC_PAGE_FLIP		0x7
+/*
+ * The CURSOR_WIDTH and CURSOR_HEIGHT capabilities return a valid widthxheight
+ * combination for the hardware cursor. The intention is that a hardware
+ * agnostic userspace can query a cursor plane size to use.
+ *
+ * Note that the cross-driver contract is to merely return a valid size;
+ * drivers are free to attach another meaning on top, eg. i915 returns the
+ * maximum plane size.
+ */
 #define DRM_CAP_CURSOR_WIDTH		0x8
 #define DRM_CAP_CURSOR_HEIGHT		0x9
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Damien Lespiau

Earlier this week, there was a bit of confusion about those new capabilities, to the point I think it's better to document the intention and API contract.

The comment documents the current situation:
- the radeon driver returns the only valid size for the hw
- i915 returns the maximun cursor size
- other drivers fall back to returning 64x64

Quoted 7 lines

The common contract is to return a valid cursor size.

Cc Sagar Kamble <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Imre Deak <[email protected]>

Agreed. Imho, it suits us to return the maximum possible size for -modesetting as it enables a broader range of userspace to use hw cursors with the only overhead of enlarged WMs.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Reviewed-by on v1 1/1
#2 lore raw
In reply to Damien Lespiau
Quoted 18 lines

-----Original Message-----
From: Damien Lespiau [mailto:[email protected]]
Sent: Friday, March 28, 2014 8:31 AM
To: [email protected]
Cc: [email protected]; Sagar Kamble; Chris Wilson; Deucher, Alexander; Imre Deak
Subject: [PATCH] drm: Specify a bit more the DRM_CAP_CURSOR_{WIDTH,HEIGHT} caps

Earlier this week, there was a bit of confusion about those new capabilities, to the point I think it's better to document the intention and API contract.

The comment documents the current situation:
- the radeon driver returns the only valid size for the hw
- i915 returns the maximun cursor size
- other drivers fall back to returning 64x64

Quoted 7 lines

The common contract is to return a valid cursor size.

Cc Sagar Kamble <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Imre Deak <[email protected]>
Quoted 28 lines
---
 include/uapi/drm/drm.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/uapi/drm/drm.h +2 -0
index b06c8ed..ec6b259 100644
@@ -619,6 +619,15 @@ struct drm_gem_open {
 #define  DRM_PRIME_CAP_EXPORT		0x2
 #define DRM_CAP_TIMESTAMP_MONOTONIC	0x6
 #define DRM_CAP_ASYNC_PAGE_FLIP		0x7
+/*
+ * The CURSOR_WIDTH and CURSOR_HEIGHT capabilities return a valid

widthxheight
+ * combination for the hardware cursor. The intention is that a hardware
+ * agnostic userspace can query a cursor plane size to use.
+ *
+ * Note that the cross-driver contract is to merely return a valid size;
+ * drivers are free to attach another meaning on top, eg. i915 returns the
+ * maximum plane size.
+ */
#define DRM_CAP_CURSOR_WIDTH 0x8
#define DRM_CAP_CURSOR_HEIGHT 0x9

--
1.8.3.1