diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-05-10 18:33:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-23 05:47:11 -0400 |
commit | 40f5cf996991577ec65d36cd3599cca7ec5d87d3 (patch) | |
tree | 903797b4e09b9444450fb35b4101c1fd9b8530b0 /drivers/gpu/drm/radeon/radeon_drv.c | |
parent | 1286ff7397737e407cdd8e5cd574318db177ba1f (diff) |
drm/radeon: add PRIME support (v2)
This adds prime->fd and fd->prime support to radeon.
It passes the sg object to ttm and then populates
the gart entries using it.
Compile tested only.
v2: stub kmap + use new helpers + add reimporting
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_drv.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index e62e56a57ee4..f0bb2b543b13 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -105,6 +105,11 @@ int radeon_mode_dumb_create(struct drm_file *file_priv, | |||
105 | int radeon_mode_dumb_destroy(struct drm_file *file_priv, | 105 | int radeon_mode_dumb_destroy(struct drm_file *file_priv, |
106 | struct drm_device *dev, | 106 | struct drm_device *dev, |
107 | uint32_t handle); | 107 | uint32_t handle); |
108 | struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, | ||
109 | struct drm_gem_object *obj, | ||
110 | int flags); | ||
111 | struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev, | ||
112 | struct dma_buf *dma_buf); | ||
108 | 113 | ||
109 | #if defined(CONFIG_DEBUG_FS) | 114 | #if defined(CONFIG_DEBUG_FS) |
110 | int radeon_debugfs_init(struct drm_minor *minor); | 115 | int radeon_debugfs_init(struct drm_minor *minor); |
@@ -333,7 +338,8 @@ static const struct file_operations radeon_driver_kms_fops = { | |||
333 | static struct drm_driver kms_driver = { | 338 | static struct drm_driver kms_driver = { |
334 | .driver_features = | 339 | .driver_features = |
335 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | | 340 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | |
336 | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM, | 341 | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_GEM | |
342 | DRIVER_PRIME, | ||
337 | .dev_priv_size = 0, | 343 | .dev_priv_size = 0, |
338 | .load = radeon_driver_load_kms, | 344 | .load = radeon_driver_load_kms, |
339 | .firstopen = radeon_driver_firstopen_kms, | 345 | .firstopen = radeon_driver_firstopen_kms, |
@@ -368,6 +374,12 @@ static struct drm_driver kms_driver = { | |||
368 | .dumb_map_offset = radeon_mode_dumb_mmap, | 374 | .dumb_map_offset = radeon_mode_dumb_mmap, |
369 | .dumb_destroy = radeon_mode_dumb_destroy, | 375 | .dumb_destroy = radeon_mode_dumb_destroy, |
370 | .fops = &radeon_driver_kms_fops, | 376 | .fops = &radeon_driver_kms_fops, |
377 | |||
378 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, | ||
379 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, | ||
380 | .gem_prime_export = radeon_gem_prime_export, | ||
381 | .gem_prime_import = radeon_gem_prime_import, | ||
382 | |||
371 | .name = DRIVER_NAME, | 383 | .name = DRIVER_NAME, |
372 | .desc = DRIVER_DESC, | 384 | .desc = DRIVER_DESC, |
373 | .date = DRIVER_DATE, | 385 | .date = DRIVER_DATE, |