diff options
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 12 | ||||
-rw-r--r-- | include/drm/drmP.h | 23 |
2 files changed, 12 insertions, 23 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index a75ca63deea6..43297ca45f3e 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -366,6 +366,18 @@ module_init(drm_core_init); | |||
366 | module_exit(drm_core_exit); | 366 | module_exit(drm_core_exit); |
367 | 367 | ||
368 | /** | 368 | /** |
369 | * Copy and IOCTL return string to user space | ||
370 | */ | ||
371 | #define DRM_COPY(name, value) \ | ||
372 | len = strlen(value); \ | ||
373 | if (len > name##_len) len = name##_len; \ | ||
374 | name##_len = strlen(value); \ | ||
375 | if (len && name) { \ | ||
376 | if (copy_to_user(name, value, len)) \ | ||
377 | return -EFAULT; \ | ||
378 | } | ||
379 | |||
380 | /** | ||
369 | * Get version information | 381 | * Get version information |
370 | * | 382 | * |
371 | * \param inode device inode. | 383 | * \param inode device inode. |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4977fa9038d9..1b72a526ba64 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -255,19 +255,8 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
255 | 255 | ||
256 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) | 256 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) |
257 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) | 257 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) |
258 | #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist) | ||
259 | 258 | ||
260 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) | 259 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) |
261 | /** | ||
262 | * Get the private SAREA mapping. | ||
263 | * | ||
264 | * \param _dev DRM device. | ||
265 | * \param _ctx context number. | ||
266 | * \param _map output mapping. | ||
267 | */ | ||
268 | #define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \ | ||
269 | (_map) = (_dev)->context_sareas[_ctx]; \ | ||
270 | } while(0) | ||
271 | 260 | ||
272 | /** | 261 | /** |
273 | * Test that the hardware lock is held by the caller, returning otherwise. | 262 | * Test that the hardware lock is held by the caller, returning otherwise. |
@@ -287,18 +276,6 @@ do { \ | |||
287 | } while (0) | 276 | } while (0) |
288 | 277 | ||
289 | /** | 278 | /** |
290 | * Copy and IOCTL return string to user space | ||
291 | */ | ||
292 | #define DRM_COPY( name, value ) \ | ||
293 | len = strlen( value ); \ | ||
294 | if ( len > name##_len ) len = name##_len; \ | ||
295 | name##_len = strlen( value ); \ | ||
296 | if ( len && name ) { \ | ||
297 | if ( copy_to_user( name, value, len ) ) \ | ||
298 | return -EFAULT; \ | ||
299 | } | ||
300 | |||
301 | /** | ||
302 | * Ioctl function type. | 279 | * Ioctl function type. |
303 | * | 280 | * |
304 | * \param inode device inode. | 281 | * \param inode device inode. |