aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-02-06 21:16:14 -0500
committerDave Airlie <airlied@redhat.com>2011-02-06 21:16:14 -0500
commitff72145badb834e8051719ea66e024784d000cb4 (patch)
tree39dc5fc512e3e0836713de9defb91ea8b4033aa2 /drivers/gpu/drm/drm_crtc.c
parent1f692a14cbfbeb11f9a9c16f25c8ecb8ab50d3d5 (diff)
drm: dumb scanout create/mmap for intel/radeon (v3)
This is just an idea that might or might not be a good idea, it basically adds two ioctls to create a dumb and map a dumb buffer suitable for scanout. The handle can be passed to the KMS ioctls to create a framebuffer. It looks to me like it would be useful in the following cases: a) in development drivers - we can always provide a shadowfb fallback. b) libkms users - we can clean up libkms a lot and avoid linking to libdrm_*. c) plymouth via libkms is a lot easier. Userspace bits would be just calls + mmaps. We could probably mark these handles somehow as not being suitable for acceleartion so as top stop people who are dumber than dumb. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 654faa803dcb..4c95b5fd9df3 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2694,3 +2694,36 @@ void drm_mode_config_reset(struct drm_device *dev)
2694 connector->funcs->reset(connector); 2694 connector->funcs->reset(connector);
2695} 2695}
2696EXPORT_SYMBOL(drm_mode_config_reset); 2696EXPORT_SYMBOL(drm_mode_config_reset);
2697
2698int drm_mode_create_dumb_ioctl(struct drm_device *dev,
2699 void *data, struct drm_file *file_priv)
2700{
2701 struct drm_mode_create_dumb *args = data;
2702
2703 if (!dev->driver->dumb_create)
2704 return -ENOSYS;
2705 return dev->driver->dumb_create(file_priv, dev, args);
2706}
2707
2708int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
2709 void *data, struct drm_file *file_priv)
2710{
2711 struct drm_mode_map_dumb *args = data;
2712
2713 /* call driver ioctl to get mmap offset */
2714 if (!dev->driver->dumb_map_offset)
2715 return -ENOSYS;
2716
2717 return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset);
2718}
2719
2720int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
2721 void *data, struct drm_file *file_priv)
2722{
2723 struct drm_mode_destroy_dumb *args = data;
2724
2725 if (!dev->driver->dumb_destroy)
2726 return -ENOSYS;
2727
2728 return dev->driver->dumb_destroy(file_priv, dev, args->handle);
2729}