summaryrefslogtreecommitdiff
path: root/src/intel/intel_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/intel_driver.c')
-rw-r--r--src/intel/intel_driver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index a6b8a583..5adf09bc 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -223,6 +223,8 @@ intel_driver_open(intel_driver_t *intel, cl_context_prop props)
char card_name[20];
for(cardi = 0; cardi < 16; cardi++) {
sprintf(card_name, "/dev/dri/renderD%d", 128+cardi);
+ if (access(card_name, R_OK) != 0)
+ continue;
if(intel_driver_init_render(intel, card_name))
break;
}
@@ -232,6 +234,8 @@ intel_driver_open(intel_driver_t *intel, cl_context_prop props)
char card_name[20];
for(cardi = 0; cardi < 16; cardi++) {
sprintf(card_name, "/dev/dri/card%d", cardi);
+ if (access(card_name, R_OK) != 0)
+ continue;
if(intel_driver_init_master(intel, card_name))
break;
}
@@ -325,7 +329,6 @@ intel_driver_init_render(intel_driver_t *driver, const char* dev_name)
{
int dev_fd, ret;
- // usually dev_name = "/dev/dri/renderD%d"
dev_fd = open(dev_name, O_RDWR);
if (dev_fd == -1)
return 0;