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>
This commit is contained in:
Micah Fedke
2015-07-22 21:54:02 +00:00
committed by Thomas Wood
parent e2241805a4
commit c81d293aed
180 changed files with 245 additions and 245 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ static void make_busy(int fd, uint32_t handle)
int main(int argc, char **argv)
{
int fd = drm_open_any();
int fd = drm_open_driver(DRIVER_INTEL);
int size = 0;
int busy = 0;
int reps = 13;
+1 -1
View File
@@ -89,7 +89,7 @@ static int loop(unsigned ring, int reps, enum mode mode)
int count, fd;
uint32_t ctx;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
memset(&gem_exec, 0, sizeof(gem_exec));
gem_exec.handle = batch(fd);
+1 -1
View File
@@ -76,7 +76,7 @@ static int loop(unsigned ring, int reps)
struct drm_i915_gem_exec_object2 gem_exec;
int count, fd;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
memset(&gem_exec, 0, sizeof(gem_exec));
gem_exec.handle = batch(fd);
+1 -1
View File
@@ -84,7 +84,7 @@ static int run(unsigned batch_size,
mem_reloc = calloc(sizeof(*mem_reloc), num_relocs);
target = calloc(sizeof(*target), num_relocs);
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
for (n = 0; n < num_objects; n++)
gem_exec[n].handle = gem_create(fd, 4096);
+1 -1
View File
@@ -118,7 +118,7 @@ static void replay(const char *filename)
madvise(ptr, st.st_size, MADV_SEQUENTIAL);
end = ptr + st.st_size;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
clock_gettime(CLOCK_MONOTONIC, &t_start);
do {
+1 -1
View File
@@ -54,7 +54,7 @@ static uint64_t elapsed(const struct timespec *start,
int main(int argc, char **argv)
{
int fd = drm_open_any();
int fd = drm_open_driver(DRIVER_INTEL);
enum map {CPU, GTT, WC} map = CPU;
enum dir {READ, WRITE, CLEAR, FAULT} dir = READ;
int tiling = I915_TILING_NONE;
+1 -1
View File
@@ -54,7 +54,7 @@ static uint64_t elapsed(const struct timespec *start,
int main(int argc, char **argv)
{
int fd = drm_open_any();
int fd = drm_open_driver(DRIVER_INTEL);
int domain = I915_GEM_DOMAIN_GTT;
enum dir { READ, WRITE } dir = READ;
void *buf = malloc(OBJECT_SIZE);
+1 -1
View File
@@ -515,7 +515,7 @@ int main(int argc, char **argv)
igt_subtest_init(argc, argv);
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
igt_assert(fd >= 0);
ret = has_userptr(fd);
+1 -1
View File
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
struct intel_batchbuffer *batch;
int i;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+1 -1
View File
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
struct intel_batchbuffer *batch;
int i;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+1 -1
View File
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
struct intel_batchbuffer *batch;
int i;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+1 -1
View File
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
struct intel_batchbuffer *batch;
int i;
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+1 -1
View File
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
}
}
fd = drm_open_any();
fd = drm_open_driver(DRIVER_INTEL);
if (!crtc0_active(fd)) {
fprintf(stderr, "CRTC/pipe 0 not active\n");
return 77;