1- /**
2- * \file drm_bufs.c
3- * Generic buffer template
4- *
5- * \author Rickard E. (Rik) Faith <faith@valinux.com>
6- * \author Gareth Hughes <gareth@valinux.com>
7- */
8-
91/*
10- * Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
2+ * Legacy: Generic DRM Buffer Management
113 *
124 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
135 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
146 * All Rights Reserved.
157 *
8+ * Author: Rickard E. (Rik) Faith <faith@valinux.com>
9+ * Author: Gareth Hughes <gareth@valinux.com>
10+ *
1611 * Permission is hereby granted, free of charge, to any person obtaining a
1712 * copy of this software and associated documentation files (the "Software"),
1813 * to deal in the Software without restriction, including without limitation
3934#include <linux/export.h>
4035#include <asm/shmparam.h>
4136#include <drm/drmP.h>
37+ #include "drm_legacy.h"
4238
4339static struct drm_map_list * drm_find_matching_map (struct drm_device * dev ,
4440 struct drm_local_map * map )
@@ -365,9 +361,9 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
365361 return 0 ;
366362}
367363
368- int drm_addmap (struct drm_device * dev , resource_size_t offset ,
369- unsigned int size , enum drm_map_type type ,
370- enum drm_map_flags flags , struct drm_local_map * * map_ptr )
364+ int drm_legacy_addmap (struct drm_device * dev , resource_size_t offset ,
365+ unsigned int size , enum drm_map_type type ,
366+ enum drm_map_flags flags , struct drm_local_map * * map_ptr )
371367{
372368 struct drm_map_list * list ;
373369 int rc ;
@@ -377,8 +373,7 @@ int drm_addmap(struct drm_device * dev, resource_size_t offset,
377373 * map_ptr = list -> map ;
378374 return rc ;
379375}
380-
381- EXPORT_SYMBOL (drm_addmap );
376+ EXPORT_SYMBOL (drm_legacy_addmap );
382377
383378/**
384379 * Ioctl to specify a range of memory that is available for mapping by a
@@ -391,8 +386,8 @@ EXPORT_SYMBOL(drm_addmap);
391386 * \return zero on success or a negative value on error.
392387 *
393388 */
394- int drm_addmap_ioctl (struct drm_device * dev , void * data ,
395- struct drm_file * file_priv )
389+ int drm_legacy_addmap_ioctl (struct drm_device * dev , void * data ,
390+ struct drm_file * file_priv )
396391{
397392 struct drm_map * map = data ;
398393 struct drm_map_list * maplist ;
@@ -429,9 +424,9 @@ int drm_addmap_ioctl(struct drm_device *dev, void *data,
429424 * its being used, and free any associate resource (such as MTRR's) if it's not
430425 * being on use.
431426 *
432- * \sa drm_addmap
427+ * \sa drm_legacy_addmap
433428 */
434- int drm_rmmap_locked (struct drm_device * dev , struct drm_local_map * map )
429+ int drm_legacy_rmmap_locked (struct drm_device * dev , struct drm_local_map * map )
435430{
436431 struct drm_map_list * r_list = NULL , * list_t ;
437432 drm_dma_handle_t dmah ;
@@ -485,19 +480,19 @@ int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
485480
486481 return 0 ;
487482}
488- EXPORT_SYMBOL (drm_rmmap_locked );
483+ EXPORT_SYMBOL (drm_legacy_rmmap_locked );
489484
490- int drm_rmmap (struct drm_device * dev , struct drm_local_map * map )
485+ int drm_legacy_rmmap (struct drm_device * dev , struct drm_local_map * map )
491486{
492487 int ret ;
493488
494489 mutex_lock (& dev -> struct_mutex );
495- ret = drm_rmmap_locked (dev , map );
490+ ret = drm_legacy_rmmap_locked (dev , map );
496491 mutex_unlock (& dev -> struct_mutex );
497492
498493 return ret ;
499494}
500- EXPORT_SYMBOL (drm_rmmap );
495+ EXPORT_SYMBOL (drm_legacy_rmmap );
501496
502497/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on
503498 * the last close of the device, and this is necessary for cleanup when things
@@ -514,8 +509,8 @@ EXPORT_SYMBOL(drm_rmmap);
514509 * \param arg pointer to a struct drm_map structure.
515510 * \return zero on success or a negative value on error.
516511 */
517- int drm_rmmap_ioctl (struct drm_device * dev , void * data ,
518- struct drm_file * file_priv )
512+ int drm_legacy_rmmap_ioctl (struct drm_device * dev , void * data ,
513+ struct drm_file * file_priv )
519514{
520515 struct drm_map * request = data ;
521516 struct drm_local_map * map = NULL ;
@@ -546,7 +541,7 @@ int drm_rmmap_ioctl(struct drm_device *dev, void *data,
546541 return 0 ;
547542 }
548543
549- ret = drm_rmmap_locked (dev , map );
544+ ret = drm_legacy_rmmap_locked (dev , map );
550545
551546 mutex_unlock (& dev -> struct_mutex );
552547
@@ -599,7 +594,8 @@ static void drm_cleanup_buf_error(struct drm_device * dev,
599594 * reallocates the buffer list of the same size order to accommodate the new
600595 * buffers.
601596 */
602- int drm_addbufs_agp (struct drm_device * dev , struct drm_buf_desc * request )
597+ int drm_legacy_addbufs_agp (struct drm_device * dev ,
598+ struct drm_buf_desc * request )
603599{
604600 struct drm_device_dma * dma = dev -> dma ;
605601 struct drm_buf_entry * entry ;
@@ -759,10 +755,11 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
759755 atomic_dec (& dev -> buf_alloc );
760756 return 0 ;
761757}
762- EXPORT_SYMBOL (drm_addbufs_agp );
758+ EXPORT_SYMBOL (drm_legacy_addbufs_agp );
763759#endif /* __OS_HAS_AGP */
764760
765- int drm_addbufs_pci (struct drm_device * dev , struct drm_buf_desc * request )
761+ int drm_legacy_addbufs_pci (struct drm_device * dev ,
762+ struct drm_buf_desc * request )
766763{
767764 struct drm_device_dma * dma = dev -> dma ;
768765 int count ;
@@ -964,9 +961,10 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
964961 return 0 ;
965962
966963}
967- EXPORT_SYMBOL (drm_addbufs_pci );
964+ EXPORT_SYMBOL (drm_legacy_addbufs_pci );
968965
969- static int drm_addbufs_sg (struct drm_device * dev , struct drm_buf_desc * request )
966+ static int drm_legacy_addbufs_sg (struct drm_device * dev ,
967+ struct drm_buf_desc * request )
970968{
971969 struct drm_device_dma * dma = dev -> dma ;
972970 struct drm_buf_entry * entry ;
@@ -1135,8 +1133,8 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
11351133 * addbufs_sg() or addbufs_pci() for AGP, scatter-gather or consistent
11361134 * PCI memory respectively.
11371135 */
1138- int drm_addbufs (struct drm_device * dev , void * data ,
1139- struct drm_file * file_priv )
1136+ int drm_legacy_addbufs (struct drm_device * dev , void * data ,
1137+ struct drm_file * file_priv )
11401138{
11411139 struct drm_buf_desc * request = data ;
11421140 int ret ;
@@ -1149,15 +1147,15 @@ int drm_addbufs(struct drm_device *dev, void *data,
11491147
11501148#if __OS_HAS_AGP
11511149 if (request -> flags & _DRM_AGP_BUFFER )
1152- ret = drm_addbufs_agp (dev , request );
1150+ ret = drm_legacy_addbufs_agp (dev , request );
11531151 else
11541152#endif
11551153 if (request -> flags & _DRM_SG_BUFFER )
1156- ret = drm_addbufs_sg (dev , request );
1154+ ret = drm_legacy_addbufs_sg (dev , request );
11571155 else if (request -> flags & _DRM_FB_BUFFER )
11581156 ret = - EINVAL ;
11591157 else
1160- ret = drm_addbufs_pci (dev , request );
1158+ ret = drm_legacy_addbufs_pci (dev , request );
11611159
11621160 return ret ;
11631161}
@@ -1179,8 +1177,8 @@ int drm_addbufs(struct drm_device *dev, void *data,
11791177 * lock, preventing of allocating more buffers after this call. Information
11801178 * about each requested buffer is then copied into user space.
11811179 */
1182- int drm_infobufs (struct drm_device * dev , void * data ,
1183- struct drm_file * file_priv )
1180+ int drm_legacy_infobufs (struct drm_device * dev , void * data ,
1181+ struct drm_file * file_priv )
11841182{
11851183 struct drm_device_dma * dma = dev -> dma ;
11861184 struct drm_buf_info * request = data ;
@@ -1260,8 +1258,8 @@ int drm_infobufs(struct drm_device *dev, void *data,
12601258 *
12611259 * \note This ioctl is deprecated and mostly never used.
12621260 */
1263- int drm_markbufs (struct drm_device * dev , void * data ,
1264- struct drm_file * file_priv )
1261+ int drm_legacy_markbufs (struct drm_device * dev , void * data ,
1262+ struct drm_file * file_priv )
12651263{
12661264 struct drm_device_dma * dma = dev -> dma ;
12671265 struct drm_buf_desc * request = data ;
@@ -1307,8 +1305,8 @@ int drm_markbufs(struct drm_device *dev, void *data,
13071305 * Calls free_buffer() for each used buffer.
13081306 * This function is primarily used for debugging.
13091307 */
1310- int drm_freebufs (struct drm_device * dev , void * data ,
1311- struct drm_file * file_priv )
1308+ int drm_legacy_freebufs (struct drm_device * dev , void * data ,
1309+ struct drm_file * file_priv )
13121310{
13131311 struct drm_device_dma * dma = dev -> dma ;
13141312 struct drm_buf_free * request = data ;
@@ -1360,8 +1358,8 @@ int drm_freebufs(struct drm_device *dev, void *data,
13601358 * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls
13611359 * drm_mmap_dma().
13621360 */
1363- int drm_mapbufs (struct drm_device * dev , void * data ,
1364- struct drm_file * file_priv )
1361+ int drm_legacy_mapbufs (struct drm_device * dev , void * data ,
1362+ struct drm_file * file_priv )
13651363{
13661364 struct drm_device_dma * dma = dev -> dma ;
13671365 int retcode = 0 ;
@@ -1448,7 +1446,7 @@ int drm_mapbufs(struct drm_device *dev, void *data,
14481446 return retcode ;
14491447}
14501448
1451- int drm_dma_ioctl (struct drm_device * dev , void * data ,
1449+ int drm_legacy_dma_ioctl (struct drm_device * dev , void * data ,
14521450 struct drm_file * file_priv )
14531451{
14541452 if (drm_core_check_feature (dev , DRIVER_MODESET ))
@@ -1460,7 +1458,7 @@ int drm_dma_ioctl(struct drm_device *dev, void *data,
14601458 return - EINVAL ;
14611459}
14621460
1463- struct drm_local_map * drm_getsarea (struct drm_device * dev )
1461+ struct drm_local_map * drm_legacy_getsarea (struct drm_device * dev )
14641462{
14651463 struct drm_map_list * entry ;
14661464
@@ -1472,4 +1470,4 @@ struct drm_local_map *drm_getsarea(struct drm_device *dev)
14721470 }
14731471 return NULL ;
14741472}
1475- EXPORT_SYMBOL (drm_getsarea );
1473+ EXPORT_SYMBOL (drm_legacy_getsarea );
0 commit comments