summaryrefslogtreecommitdiff
path: root/tests/prime_self_import.c
diff options
context:
space:
mode:
authorMicah Fedke <micah.fedke@collabora.co.uk>2015-07-22 21:54:02 +0000
committerThomas Wood <thomas.wood@intel.com>2015-09-11 14:39:43 +0100
commitc81d293aed94fea9c48899187016a1b28f8989d5 (patch)
tree7d7fd67c9f8eb843b799111e8cf0776829cd585e /tests/prime_self_import.c
parente2241805a43e2cbd5287010e90005542845b48cd (diff)
convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tests/prime_self_import.c')
-rw-r--r--tests/prime_self_import.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 27dddf22..6c09cb0d 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -88,8 +88,8 @@ static void test_with_fd_dup(void)
counter = 0;
- fd1 = drm_open_any();
- fd2 = drm_open_any();
+ fd1 = drm_open_driver(DRIVER_INTEL);
+ fd2 = drm_open_driver(DRIVER_INTEL);
handle = gem_create(fd1, BO_SIZE);
@@ -116,8 +116,8 @@ static void test_with_two_bos(void)
counter = 0;
- fd1 = drm_open_any();
- fd2 = drm_open_any();
+ fd1 = drm_open_driver(DRIVER_INTEL);
+ fd2 = drm_open_driver(DRIVER_INTEL);
handle1 = gem_create(fd1, BO_SIZE);
handle2 = gem_create(fd1, BO_SIZE);
@@ -147,8 +147,8 @@ static void test_with_one_bo_two_files(void)
uint32_t handle_import, handle_open, handle_orig, flink_name;
int dma_buf_fd1, dma_buf_fd2;
- fd1 = drm_open_any();
- fd2 = drm_open_any();
+ fd1 = drm_open_driver(DRIVER_INTEL);
+ fd2 = drm_open_driver(DRIVER_INTEL);
handle_orig = gem_create(fd1, BO_SIZE);
dma_buf_fd1 = prime_handle_to_fd(fd1, handle_orig);
@@ -174,8 +174,8 @@ static void test_with_one_bo(void)
uint32_t handle, handle_import1, handle_import2, handle_selfimport;
int dma_buf_fd;
- fd1 = drm_open_any();
- fd2 = drm_open_any();
+ fd1 = drm_open_driver(DRIVER_INTEL);
+ fd2 = drm_open_driver(DRIVER_INTEL);
handle = gem_create(fd1, BO_SIZE);
@@ -258,7 +258,7 @@ static void test_reimport_close_race(void)
/* Allocate exit handler fds in here so that we dont screw
* up the counts */
- fake = drm_open_any();
+ fake = drm_open_driver(DRIVER_INTEL);
gem_quiescent_gpu(fake);
obj_count = get_object_count();
@@ -267,7 +267,7 @@ static void test_reimport_close_race(void)
threads = calloc(num_threads, sizeof(pthread_t));
- fds[0] = drm_open_any();
+ fds[0] = drm_open_driver(DRIVER_INTEL);
handle = gem_create(fds[0], BO_SIZE);
@@ -350,12 +350,12 @@ static void test_export_close_race(void)
/* Allocate exit handler fds in here so that we dont screw
* up the counts */
- fake = drm_open_any();
+ fake = drm_open_driver(DRIVER_INTEL);
gem_quiescent_gpu(fake);
obj_count = get_object_count();
- fd = drm_open_any();
+ fd = drm_open_driver(DRIVER_INTEL);
for (i = 0; i < num_threads; i++) {
r = pthread_create(&threads[i], NULL,
@@ -393,7 +393,7 @@ static void test_llseek_size(void)
counter = 0;
- fd = drm_open_any();
+ fd = drm_open_driver(DRIVER_INTEL);
for (i = 0; i < 10; i++) {
@@ -420,7 +420,7 @@ static void test_llseek_bad(void)
counter = 0;
- fd = drm_open_any();
+ fd = drm_open_driver(DRIVER_INTEL);
handle = gem_create(fd, BO_SIZE);