summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-05-29 11:21:38 +1000
committerDave Airlie <[email protected]>2018-05-30 09:11:53 +1000
commitb7ac0779e0228969536a6738926b8b7a0d565cd4 (patch)
tree951eecc4de17cc6d0df92fe0c2894be0b8fee773 /src/gallium/winsys
parentd2eaff33d0132ef17eb458f04e5369985129ce31 (diff)
gallium/winsys: rename DRM_API_HANDLE_* to WINSYS_HANDLE_*
This just renames this as we want to add an shm handle which isn't really drm related. Originally by: Marc-André Lureau <[email protected]> (airlied: I used this sed script instead) This was generated with: git grep -l 'DRM_API_' | xargs sed -i 's/DRM_API_/WINSYS_/g' Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c10
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_buffer.c12
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c14
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_dri.c14
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_ioctl.c6
-rw-r--r--src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c12
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c12
7 files changed, 40 insertions, 40 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 9b6d6e83032..df8b8292fa0 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -1277,10 +1277,10 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,
}
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
type = amdgpu_bo_handle_type_gem_flink_name;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
type = amdgpu_bo_handle_type_dma_buf_fd;
break;
default:
@@ -1365,13 +1365,13 @@ static bool amdgpu_bo_get_handle(struct pb_buffer *buffer,
bo->u.real.use_reusable_pool = false;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_SHARED:
type = amdgpu_bo_handle_type_gem_flink_name;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
type = amdgpu_bo_handle_type_dma_buf_fd;
break;
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
type = amdgpu_bo_handle_type_kms;
break;
default:
diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index 890f7dc2833..509984ac6ac 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -98,7 +98,7 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
struct i915_drm_buffer *buf;
uint32_t tile = 0, swizzle = 0;
- if ((whandle->type != DRM_API_HANDLE_TYPE_SHARED) && (whandle->type != DRM_API_HANDLE_TYPE_FD))
+ if ((whandle->type != WINSYS_HANDLE_TYPE_SHARED) && (whandle->type != WINSYS_HANDLE_TYPE_FD))
return NULL;
if (whandle->offset != 0)
@@ -110,9 +110,9 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
buf->magic = 0xDEAD1337;
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED)
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED)
buf->bo = drm_intel_bo_gem_create_from_name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);
- else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
int fd = (int) whandle->handle;
buf->bo = drm_intel_bo_gem_create_from_prime(idws->gem_manager, fd, height * whandle->stride);
}
@@ -143,7 +143,7 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
{
struct i915_drm_buffer *buf = i915_drm_buffer(buffer);
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!buf->flinked) {
if (drm_intel_bo_flink(buf->bo, &buf->flink))
return FALSE;
@@ -151,9 +151,9 @@ i915_drm_buffer_get_handle(struct i915_winsys *iws,
}
whandle->handle = buf->flink;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
whandle->handle = buf->bo->handle;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
int fd;
if (drm_intel_bo_gem_export_to_prime(buf->bo, &fd))
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 6652977e586..93ab4791c55 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -1157,10 +1157,10 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
* The list of pairs is guarded by a mutex, of course. */
mtx_lock(&ws->bo_handles_mutex);
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
/* First check if there already is an existing bo for the handle. */
bo = util_hash_table_get(ws->bo_names, (void*)(uintptr_t)whandle->handle);
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
/* We must first get the GEM handle, as fds are unreliable keys */
r = drmPrimeFDToHandle(ws->fd, whandle->handle, &handle);
if (r)
@@ -1184,7 +1184,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
goto fail;
}
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
struct drm_gem_open open_arg = {};
memset(&open_arg, 0, sizeof(open_arg));
/* Open the BO. */
@@ -1196,7 +1196,7 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
handle = open_arg.handle;
size = open_arg.size;
bo->flink_name = whandle->handle;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
size = lseek(whandle->handle, 0, SEEK_END);
/*
* Could check errno to determine whether the kernel is new enough, but
@@ -1301,7 +1301,7 @@ static bool radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
bo->u.real.use_reusable_pool = false;
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!bo->flink_name) {
flink.handle = bo->handle;
@@ -1316,9 +1316,9 @@ static bool radeon_winsys_bo_get_handle(struct pb_buffer *buffer,
mtx_unlock(&ws->bo_handles_mutex);
}
whandle->handle = bo->flink_name;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
whandle->handle = bo->handle;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
if (drmPrimeHandleToFD(ws->fd, bo->handle, DRM_CLOEXEC, (int*)&whandle->handle))
return false;
}
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_dri.c b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
index 2a0ac7b3337..76f29e2aced 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_dri.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_dri.c
@@ -234,11 +234,11 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
}
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_KMS:
handle = whandle->handle;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
ret = drmPrimeFDToHandle(vws->ioctl.drm_fd, whandle->handle,
&handle);
if (ret) {
@@ -263,7 +263,7 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
/*
* Need to close the handle we got from prime.
*/
- if (whandle->type == DRM_API_HANDLE_TYPE_FD)
+ if (whandle->type == WINSYS_HANDLE_TYPE_FD)
vmw_ioctl_surface_destroy(vws, handle);
if (ret) {
@@ -340,11 +340,11 @@ vmw_drm_surface_get_handle(struct svga_winsys_screen *sws,
whandle->offset = 0;
switch (whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_KMS:
whandle->handle = vsrf->sid;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
ret = drmPrimeHandleToFD(vws->ioctl.drm_fd, vsrf->sid, DRM_CLOEXEC,
(int *)&whandle->handle);
if (ret) {
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 62a2af6d650..16dd5c8593a 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -290,13 +290,13 @@ vmw_ioctl_surface_req(const struct vmw_winsys_screen *vws,
int ret;
switch(whandle->type) {
- case DRM_API_HANDLE_TYPE_SHARED:
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_SHARED:
+ case WINSYS_HANDLE_TYPE_KMS:
*needs_unref = FALSE;
req->handle_type = DRM_VMW_HANDLE_LEGACY;
req->sid = whandle->handle;
break;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
if (!vws->ioctl.have_drm_2_6) {
uint32_t handle;
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index d842fe3257a..3fe1b1a7313 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -385,11 +385,11 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
struct kms_sw_plane *kms_sw_pl;
- assert(whandle->type == DRM_API_HANDLE_TYPE_KMS ||
- whandle->type == DRM_API_HANDLE_TYPE_FD);
+ assert(whandle->type == WINSYS_HANDLE_TYPE_KMS ||
+ whandle->type == WINSYS_HANDLE_TYPE_FD);
switch(whandle->type) {
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
kms_sw_pl = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle,
templ->format,
templ->width0,
@@ -399,7 +399,7 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
if (kms_sw_pl)
*stride = kms_sw_pl->stride;
return sw_displaytarget(kms_sw_pl);
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
kms_sw_dt = kms_sw_displaytarget_find_and_ref(kms_sw, whandle->handle);
if (kms_sw_dt) {
struct kms_sw_plane *plane;
@@ -430,12 +430,12 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct kms_sw_displaytarget *kms_sw_dt = plane->dt;
switch(whandle->type) {
- case DRM_API_HANDLE_TYPE_KMS:
+ case WINSYS_HANDLE_TYPE_KMS:
whandle->handle = kms_sw_dt->handle;
whandle->stride = plane->stride;
whandle->offset = plane->offset;
return TRUE;
- case DRM_API_HANDLE_TYPE_FD:
+ case WINSYS_HANDLE_TYPE_FD:
if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle,
DRM_CLOEXEC, (int*)&whandle->handle)) {
whandle->stride = plane->stride;
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 4198ed7feb3..fb15708ddb1 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -398,7 +398,7 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
mtx_lock(&qdws->bo_handles_mutex);
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
res = util_hash_table_get(qdws->bo_names, (void*)(uintptr_t)handle);
if (res) {
struct virgl_hw_res *r = NULL;
@@ -407,7 +407,7 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
}
}
- if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
int r;
r = drmPrimeFDToHandle(qdws->fd, whandle->handle, &handle);
if (r) {
@@ -428,7 +428,7 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
if (!res)
goto done;
- if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
res->bo_handle = handle;
} else {
fprintf(stderr, "gem open handle %d\n", handle);
@@ -478,7 +478,7 @@ static boolean virgl_drm_winsys_resource_get_handle(struct virgl_winsys *qws,
if (!res)
return FALSE;
- if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
+ if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
if (!res->flinked) {
memset(&flink, 0, sizeof(flink));
flink.handle = res->bo_handle;
@@ -494,9 +494,9 @@ static boolean virgl_drm_winsys_resource_get_handle(struct virgl_winsys *qws,
mtx_unlock(&qdws->bo_handles_mutex);
}
whandle->handle = res->flink;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
whandle->handle = res->bo_handle;
- } else if (whandle->type == DRM_API_HANDLE_TYPE_FD) {
+ } else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
if (drmPrimeHandleToFD(qdws->fd, res->bo_handle, DRM_CLOEXEC, (int*)&whandle->handle))
return FALSE;
mtx_lock(&qdws->bo_handles_mutex);