History

drm: add DRM_CAPs for cursor size

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.

Alex Deucher committed 12 years ago

Commit 8716ed41 parent 7d5a33b3 files · +17 −0Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/drm_ioctl.c +12 −0
  2. include/drm/drm_crtc.h +3 −0
  3. include/uapi/drm/drm.h +2 −0
drivers/gpu/drm/drm_ioctl.c+12−0
@@ -296,6 +296,18 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv) · 295 unmodified lines
296296 case DRM_CAP_ASYNC_PAGE_FLIP:
297297 req->value = dev->mode_config.async_page_flip;
298298 break;
299+ case DRM_CAP_CURSOR_WIDTH:
300+ if (dev->mode_config.cursor_width)
301+ req->value = dev->mode_config.cursor_width;
302+ else
303+ req->value = 64;
304+ break;
305+ case DRM_CAP_CURSOR_HEIGHT:
306+ if (dev->mode_config.cursor_height)
307+ req->value = dev->mode_config.cursor_height;
308+ else
309+ req->value = 64;
310+ break;
299311 default:
300312 return -EINVAL;
301313 }
include/drm/drm_crtc.h+3−0
@@ -907,6 +907,9 @@ struct drm_mode_config { · 906 unmodified lines
907907
908908 /* whether async page flip is supported or not */
909909 bool async_page_flip;
910+
911+ /* cursor size */
912+ uint32_t cursor_width, cursor_height;
910913 };
911914
912915 #define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
include/uapi/drm/drm.h+2−0
@@ -619,6 +619,8 @@ struct drm_gem_open { · 618 unmodified lines
619619 #define DRM_PRIME_CAP_EXPORT 0x2
620620 #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
621621 #define DRM_CAP_ASYNC_PAGE_FLIP 0x7
622+#define DRM_CAP_CURSOR_WIDTH 0x8
623+#define DRM_CAP_CURSOR_HEIGHT 0x9
622624
623625 /** DRM_IOCTL_GET_CAP ioctl argument type */
624626 struct drm_get_cap {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t