summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_scatter.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-08 15:41:17 +0200
committerDave Airlie <airlied@redhat.com>2013-08-19 10:03:49 +1000
commit3d914e8357256e7e92d1b7dd2dda9cf94e39c4e8 (patch)
tree252aea0277f6713ba7b57e7e6615f599e373186b /drivers/gpu/drm/drm_scatter.c
parent45886af246d926304d5e990da63d55d9db3216c0 (diff)
downloadblackbird-op-linux-3d914e8357256e7e92d1b7dd2dda9cf94e39c4e8.tar.gz
blackbird-op-linux-3d914e8357256e7e92d1b7dd2dda9cf94e39c4e8.zip
drm: hide legacy sg cleanup better from common code
I've decided that some clear markers for what's legacy dri1/non-gem code is useful. I've opted to use the drm_legacy prefix and then hide all the checks in that function for better readability in the common code. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_scatter.c')
-rw-r--r--drivers/gpu/drm/drm_scatter.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
index a4a076ff1757..dd8a6480065c 100644
--- a/drivers/gpu/drm/drm_scatter.c
+++ b/drivers/gpu/drm/drm_scatter.c
@@ -46,7 +46,7 @@ static inline void *drm_vmalloc_dma(unsigned long size)
#endif
}
-void drm_sg_cleanup(struct drm_sg_mem * entry)
+static void drm_sg_cleanup(struct drm_sg_mem * entry)
{
struct page *page;
int i;
@@ -64,6 +64,14 @@ void drm_sg_cleanup(struct drm_sg_mem * entry)
kfree(entry);
}
+void drm_legacy_sg_cleanup(struct drm_device *dev)
+{
+ if (drm_core_check_feature(dev, DRIVER_SG) && dev->sg &&
+ !drm_core_check_feature(dev, DRIVER_MODESET)) {
+ drm_sg_cleanup(dev->sg);
+ dev->sg = NULL;
+ }
+}
#ifdef _LP64
# define ScatterHandle(x) (unsigned int)((x >> 32) + (x & ((1L << 32) - 1)))
#else
OpenPOWER on IntegriCloud