[PATCH 1/2] drm: add DRM_CAPs for cursor size (original) (raw)

Rob Clark robdclark at gmail.com
Fri Feb 14 13:02:12 PST 2014


On Wed, Feb 12, 2014 at 1:28 PM, Alex Deucher <alexdeucher at gmail.com> wrote:

Some hardware may not support standard 64x64 cursors. Add a drm cap to query the cursor size from the kernel. Some examples include radeon CIK parts (128x128 cursors) and armada (32x64 or 64x32). This allows things like device specific ddxes to remove asics specific logic and also allows xf86-video-modesetting to work properly with hw cursors on this hardware. Default to 64 if the driver doesn't specify a size.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

Reviewed-by: Rob Clark <robdclark at gmail.com>

--- drivers/gpu/drm/drmioctl.c | 12 ++++++++++++ include/drm/drmcrtc.h | 3 +++ include/uapi/drm/drm.h | 2 ++ 3 files changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/drmioctl.c b/drivers/gpu/drm/drmioctl.c index dffc836..f4dc9b7 100644 --- a/drivers/gpu/drm/drmioctl.c +++ b/drivers/gpu/drm/drmioctl.c @@ -296,6 +296,18 @@ int drmgetcap(struct drmdevice *dev, void *data, struct drmfile *filepriv) case DRMCAPASYNCPAGEFLIP: req->value = dev->modeconfig.asyncpageflip; break; + case DRMCAPCURSORWIDTH: + if (dev->modeconfig.cursorwidth) + req->value = dev->modeconfig.cursorwidth; + else + req->value = 64; + break; + case DRMCAPCURSORHEIGHT: + if (dev->modeconfig.cursorheight) + req->value = dev->modeconfig.cursorheight; + else + req->value = 64; + break; default: return -EINVAL; } diff --git a/include/drm/drmcrtc.h b/include/drm/drmcrtc.h index 71727b6..8f3dee0 100644 --- a/include/drm/drmcrtc.h +++ b/include/drm/drmcrtc.h @@ -907,6 +907,9 @@ struct drmmodeconfig { /* whether async page flip is supported or not */ bool asyncpageflip; + + /* cursor size */ + uint32t cursorwidth, cursorheight; }; #define objtocrtc(x) containerof(x, struct drmcrtc, base) diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 3c9a833..b06c8ed 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -619,6 +619,8 @@ struct drmgemopen { #define DRMPRIMECAPEXPORT 0x2 #define DRMCAPTIMESTAMPMONOTONIC 0x6 #define DRMCAPASYNCPAGEFLIP 0x7 +#define DRMCAPCURSORWIDTH 0x8 +#define DRMCAPCURSORHEIGHT 0x9 /** DRMIOCTLGETCAP ioctl argument type */ struct drmgetcap { -- 1.8.3.1


dri-devel mailing list dri-devel at lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel



More information about the dri-devel mailing list