aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_drm2/ecore_drm2.c40
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c64
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c116
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c122
4 files changed, 191 insertions, 151 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2.c b/src/lib/ecore_drm2/ecore_drm2.c
index 372886660f..ddedac6061 100644
--- a/src/lib/ecore_drm2/ecore_drm2.c
+++ b/src/lib/ecore_drm2/ecore_drm2.c
@@ -5,6 +5,46 @@ static void *drm_lib = NULL;
int _ecore_drm2_log_dom = -1;
+int (*sym_drmHandleEvent)(int fd, drmEventContext *evctx) = NULL;
+void *(*sym_drmGetVersion)(int fd) = NULL;
+void (*sym_drmFreeVersion)(void *drmver) = NULL;
+void *(*sym_drmModeGetProperty)(int fd, uint32_t propertyId) = NULL;
+void (*sym_drmModeFreeProperty)(drmModePropertyPtr ptr) = NULL;
+void *(*sym_drmModeGetPropertyBlob)(int fd, uint32_t blob_id) = NULL;
+void (*sym_drmModeFreePropertyBlob)(drmModePropertyBlobPtr ptr) = NULL;
+int (*sym_drmModeDestroyPropertyBlob)(int fd, uint32_t id) = NULL;
+int (*sym_drmIoctl)(int fd, unsigned long request, void *arg) = NULL;
+void *(*sym_drmModeObjectGetProperties)(int fd, uint32_t object_id, uint32_t object_type) = NULL;
+void (*sym_drmModeFreeObjectProperties)(drmModeObjectPropertiesPtr ptr) = NULL;
+int (*sym_drmModeCreatePropertyBlob)(int fd, const void *data, size_t size, uint32_t *id) = NULL;
+# ifdef HAVE_ATOMIC_DRM
+void *(*sym_drmModeAtomicAlloc)(void) = NULL;
+void (*sym_drmModeAtomicFree)(drmModeAtomicReqPtr req) = NULL;
+int (*sym_drmModeAtomicAddProperty)(drmModeAtomicReqPtr req, uint32_t object_id, uint32_t property_id, uint64_t value) = NULL;
+int (*sym_drmModeAtomicCommit)(int fd, drmModeAtomicReqPtr req, uint32_t flags, void *user_data) = NULL;
+void (*sym_drmModeAtomicSetCursor)(drmModeAtomicReqPtr req, int cursor) = NULL;
+# endif
+void *(*sym_drmModeGetEncoder)(int fd, uint32_t encoder_id) = NULL;
+void (*sym_drmModeFreeEncoder)(drmModeEncoderPtr ptr) = NULL;
+void *(*sym_drmModeGetCrtc)(int fd, uint32_t crtcId) = NULL;
+void (*sym_drmModeFreeCrtc)(drmModeCrtcPtr ptr) = NULL;
+int (*sym_drmModeSetCrtc)(int fd, uint32_t crtcId, uint32_t bufferId, uint32_t x, uint32_t y, uint32_t *connectors, int count, drmModeModeInfoPtr mode) = NULL;
+void *(*sym_drmModeGetResources)(int fd) = NULL;
+void (*sym_drmModeFreeResources)(drmModeResPtr ptr) = NULL;
+void *(*sym_drmModeGetConnector)(int fd, uint32_t connectorId) = NULL;
+void (*sym_drmModeFreeConnector)(drmModeConnectorPtr ptr) = NULL;
+int (*sym_drmModeConnectorSetProperty)(int fd, uint32_t connector_id, uint32_t property_id, uint64_t value) = NULL;
+int (*sym_drmGetCap)(int fd, uint64_t capability, uint64_t *value) = NULL;
+int (*sym_drmSetClientCap)(int fd, uint64_t capability, uint64_t value) = NULL;
+void *(*sym_drmModeGetPlaneResources)(int fd) = NULL;
+void (*sym_drmModeFreePlaneResources)(drmModePlaneResPtr ptr) = NULL;
+void *(*sym_drmModeGetPlane)(int fd, uint32_t plane_id) = NULL;
+void (*sym_drmModeFreePlane)(drmModePlanePtr ptr) = NULL;
+int (*sym_drmModeAddFB)(int fd, uint32_t width, uint32_t height, uint8_t depth, uint8_t bpp, uint32_t pitch, uint32_t bo_handle, uint32_t *buf_id) = NULL;
+int (*sym_drmModeRmFB)(int fd, uint32_t bufferId) = NULL;
+int (*sym_drmModePageFlip)(int fd, uint32_t crtc_id, uint32_t fb_id, uint32_t flags, void *user_data) = NULL;
+int (*sym_drmModeDirtyFB)(int fd, uint32_t bufferId, drmModeClipPtr clips, uint32_t num_clips) = NULL;
+
EAPI int ECORE_DRM2_EVENT_OUTPUT_CHANGED = -1;
EAPI int ECORE_DRM2_EVENT_ACTIVATE = -1;
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 6cd415b481..10294af626 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -156,7 +156,7 @@ _drm2_atomic_usable(int fd)
drmVersion *drmver;
Eina_Bool ret = EINA_FALSE;
- drmver = drmGetVersion(fd);
+ drmver = sym_drmGetVersion(fd);
if (!drmver) return EINA_FALSE;
/* detect driver */
@@ -187,7 +187,7 @@ _drm2_atomic_usable(int fd)
}
}
- drmFreeVersion(drmver);
+ sym_drmFreeVersion(drmver);
return ret;
}
@@ -201,7 +201,7 @@ _drm2_atomic_state_crtc_fill(Ecore_Drm2_Crtc_State *cstate, int fd)
DBG("Atomic State Crtc Fill");
oprops =
- drmModeObjectGetProperties(fd, cstate->obj_id, DRM_MODE_OBJECT_CRTC);
+ sym_drmModeObjectGetProperties(fd, cstate->obj_id, DRM_MODE_OBJECT_CRTC);
if (!oprops) return;
DBG("\tCrtc %d", cstate->obj_id);
@@ -210,7 +210,7 @@ _drm2_atomic_state_crtc_fill(Ecore_Drm2_Crtc_State *cstate, int fd)
{
drmModePropertyPtr prop;
- prop = drmModeGetProperty(fd, oprops->props[i]);
+ prop = sym_drmModeGetProperty(fd, oprops->props[i]);
if (!prop) continue;
DBG("\t\tProperty: %s %d", prop->name, i);
@@ -229,7 +229,7 @@ _drm2_atomic_state_crtc_fill(Ecore_Drm2_Crtc_State *cstate, int fd)
goto cont;
}
- bp = drmModeGetPropertyBlob(fd, cstate->mode.value);
+ bp = sym_drmModeGetPropertyBlob(fd, cstate->mode.value);
if (!bp) goto cont;
if ((!cstate->mode.data) ||
@@ -242,10 +242,10 @@ _drm2_atomic_state_crtc_fill(Ecore_Drm2_Crtc_State *cstate, int fd)
cstate->mode.len = bp->length;
if (cstate->mode.value != 0)
- drmModeCreatePropertyBlob(fd, bp->data, bp->length,
+ sym_drmModeCreatePropertyBlob(fd, bp->data, bp->length,
&cstate->mode.value);
- drmModeFreePropertyBlob(bp);
+ sym_drmModeFreePropertyBlob(bp);
}
else if (!strcmp(prop->name, "ACTIVE"))
{
@@ -255,10 +255,10 @@ _drm2_atomic_state_crtc_fill(Ecore_Drm2_Crtc_State *cstate, int fd)
}
cont:
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
}
- drmModeFreeObjectProperties(oprops);
+ sym_drmModeFreeObjectProperties(oprops);
}
static void
@@ -270,7 +270,7 @@ _drm2_atomic_state_conn_fill(Ecore_Drm2_Connector_State *cstate, int fd)
DBG("Atomic State Connector Fill");
oprops =
- drmModeObjectGetProperties(fd, cstate->obj_id, DRM_MODE_OBJECT_CONNECTOR);
+ sym_drmModeObjectGetProperties(fd, cstate->obj_id, DRM_MODE_OBJECT_CONNECTOR);
if (!oprops) return;
DBG("\tConnector: %d", cstate->obj_id);
@@ -279,7 +279,7 @@ _drm2_atomic_state_conn_fill(Ecore_Drm2_Connector_State *cstate, int fd)
{
drmModePropertyPtr prop;
- prop = drmModeGetProperty(fd, oprops->props[i]);
+ prop = sym_drmModeGetProperty(fd, oprops->props[i]);
if (!prop) continue;
DBG("\t\tProperty: %s", prop->name);
@@ -307,7 +307,7 @@ _drm2_atomic_state_conn_fill(Ecore_Drm2_Connector_State *cstate, int fd)
goto cont;
}
- bp = drmModeGetPropertyBlob(fd, cstate->edid.id);
+ bp = sym_drmModeGetPropertyBlob(fd, cstate->edid.id);
if (!bp) goto cont;
if ((!cstate->edid.data) ||
@@ -320,10 +320,10 @@ _drm2_atomic_state_conn_fill(Ecore_Drm2_Connector_State *cstate, int fd)
cstate->edid.len = bp->length;
if (cstate->edid.id != 0)
- drmModeCreatePropertyBlob(fd, bp->data, bp->length,
+ sym_drmModeCreatePropertyBlob(fd, bp->data, bp->length,
&cstate->edid.id);
- drmModeFreePropertyBlob(bp);
+ sym_drmModeFreePropertyBlob(bp);
}
else if (!strcmp(prop->name, "aspect ratio"))
{
@@ -339,10 +339,10 @@ _drm2_atomic_state_conn_fill(Ecore_Drm2_Connector_State *cstate, int fd)
}
cont:
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
}
- drmModeFreeObjectProperties(oprops);
+ sym_drmModeFreeObjectProperties(oprops);
}
static void
@@ -355,7 +355,7 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
DBG("Atomic State Plane Fill");
oprops =
- drmModeObjectGetProperties(fd, pstate->obj_id, DRM_MODE_OBJECT_PLANE);
+ sym_drmModeObjectGetProperties(fd, pstate->obj_id, DRM_MODE_OBJECT_PLANE);
if (!oprops) return;
DBG("\tPlane: %d", pstate->obj_id);
@@ -364,7 +364,7 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
{
drmModePropertyPtr prop;
- prop = drmModeGetProperty(fd, oprops->props[i]);
+ prop = sym_drmModeGetProperty(fd, oprops->props[i]);
if (!prop) continue;
DBG("\t\tProperty: %s", prop->name);
@@ -472,10 +472,10 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
}
}
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
}
- drmModeFreeObjectProperties(oprops);
+ sym_drmModeFreeObjectProperties(oprops);
}
static void
@@ -485,10 +485,10 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
drmModeResPtr res;
drmModePlaneResPtr pres;
- res = drmModeGetResources(fd);
+ res = sym_drmModeGetResources(fd);
if (!res) return;
- pres = drmModeGetPlaneResources(fd);
+ pres = sym_drmModeGetPlaneResources(fd);
if (!pres) goto err;
state->crtcs = res->count_crtcs;
@@ -532,23 +532,23 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
drmModePlanePtr plane;
Ecore_Drm2_Plane_State *pstate;
- plane = drmModeGetPlane(fd, pres->planes[i]);
+ plane = sym_drmModeGetPlane(fd, pres->planes[i]);
if (!plane) continue;
pstate = &state->plane_states[i];
pstate->obj_id = pres->planes[i];
pstate->mask = plane->possible_crtcs;
- drmModeFreePlane(plane);
+ sym_drmModeFreePlane(plane);
_drm2_atomic_state_plane_fill(pstate, fd);
}
}
- drmModeFreePlaneResources(pres);
+ sym_drmModeFreePlaneResources(pres);
err:
- drmModeFreeResources(res);
+ sym_drmModeFreeResources(res);
}
static void
@@ -614,15 +614,15 @@ ecore_drm2_device_open(Ecore_Drm2_Device *device)
_ecore_drm2_use_atomic = _drm2_atomic_usable(device->fd);
if (_ecore_drm2_use_atomic)
{
- if (drmSetClientCap(device->fd, DRM_CLIENT_CAP_ATOMIC, 1) < 0)
+ if (sym_drmSetClientCap(device->fd, DRM_CLIENT_CAP_ATOMIC, 1) < 0)
{
WRN("Could not enable Atomic Modesetting support");
_ecore_drm2_use_atomic = EINA_FALSE;
}
else
{
- if (drmSetClientCap(device->fd,
- DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0)
+ if (sym_drmSetClientCap(device->fd,
+ DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1) < 0)
WRN("Could not enable Universal Plane support");
else
{
@@ -686,7 +686,7 @@ ecore_drm2_device_clock_id_get(Ecore_Drm2_Device *device)
EINA_SAFETY_ON_NULL_RETURN_VAL(device, -1);
EINA_SAFETY_ON_TRUE_RETURN_VAL((device->fd < 0), -1);
- ret = drmGetCap(device->fd, DRM_CAP_TIMESTAMP_MONOTONIC, &caps);
+ ret = sym_drmGetCap(device->fd, DRM_CAP_TIMESTAMP_MONOTONIC, &caps);
if ((ret == 0) && (caps == 1))
return CLOCK_MONOTONIC;
else
@@ -705,13 +705,13 @@ ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *device, int *width, int *he
if (width)
{
*width = 64;
- ret = drmGetCap(device->fd, DRM_CAP_CURSOR_WIDTH, &caps);
+ ret = sym_drmGetCap(device->fd, DRM_CAP_CURSOR_WIDTH, &caps);
if (ret == 0) *width = caps;
}
if (height)
{
*height = 64;
- ret = drmGetCap(device->fd, DRM_CAP_CURSOR_HEIGHT, &caps);
+ ret = sym_drmGetCap(device->fd, DRM_CAP_CURSOR_HEIGHT, &caps);
if (ret == 0) *height = caps;
}
}
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 149bb75beb..3f7b9ef8e4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -3,7 +3,7 @@
static Eina_Bool
_fb2_create(Ecore_Drm2_Fb *fb)
{
- struct drm_mode_fb_cmd2 cmd;
+ drm_mode_fb_cmd2 cmd;
uint32_t hdls[4] = { 0 }, pitches[4] = { 0 }, offsets[4] = { 0 };
uint64_t modifiers[4] = { 0 };
@@ -12,7 +12,7 @@ _fb2_create(Ecore_Drm2_Fb *fb)
offsets[0] = 0;
modifiers[0] = 0;
- memset(&cmd, 0, sizeof(struct drm_mode_fb_cmd2));
+ memset(&cmd, 0, sizeof(drm_mode_fb_cmd2));
cmd.fb_id = 0;
cmd.width = fb->w;
cmd.height = fb->h;
@@ -23,7 +23,7 @@ _fb2_create(Ecore_Drm2_Fb *fb)
memcpy(cmd.offsets, offsets, 4 * sizeof(offsets[0]));
memcpy(cmd.modifier, modifiers, 4 * sizeof(modifiers[0]));
- if (drmIoctl(fb->fd, DRM_IOCTL_MODE_ADDFB2, &cmd))
+ if (sym_drmIoctl(fb->fd, DRM_IOCTL_MODE_ADDFB2, &cmd))
return EINA_FALSE;
fb->id = cmd.fb_id;
@@ -39,67 +39,67 @@ _fb_atomic_flip(Ecore_Drm2_Output *output, Ecore_Drm2_Plane_State *pstate, uint3
drmModeAtomicReq *req = NULL;
Ecore_Drm2_Crtc_State *cstate;
- req = drmModeAtomicAlloc();
+ req = sym_drmModeAtomicAlloc();
if (!req) return -1;
- drmModeAtomicSetCursor(req, 0);
+ sym_drmModeAtomicSetCursor(req, 0);
cstate = output->crtc_state;
- ret = drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
- cstate->mode.value);
+ ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
+ cstate->mode.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, cstate->obj_id, cstate->active.id,
- cstate->active.value);
+ ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->active.id,
+ cstate->active.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->cid.id, pstate->cid.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->cid.id, pstate->cid.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->fid.id, pstate->fid.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->fid.id, pstate->fid.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->sx.id, pstate->sx.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->sx.id, pstate->sx.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->sy.id, pstate->sy.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->sy.id, pstate->sy.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->sw.id, pstate->sw.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->sw.id, pstate->sw.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->sh.id, pstate->sh.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->sh.id, pstate->sh.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->cx.id, pstate->cx.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->cx.id, pstate->cx.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->cy.id, pstate->cy.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->cy.id, pstate->cy.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->cw.id, pstate->cw.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->cw.id, pstate->cw.value);
if (ret < 0) goto err;
- ret = drmModeAtomicAddProperty(req, pstate->obj_id,
- pstate->ch.id, pstate->ch.value);
+ ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
+ pstate->ch.id, pstate->ch.value);
if (ret < 0) goto err;
- ret = drmModeAtomicCommit(output->fd, req, flags, output->user_data);
+ ret = sym_drmModeAtomicCommit(output->fd, req, flags, output->user_data);
if (ret < 0) ERR("Failed to commit Atomic FB Flip: %m");
else ret = 0;
err:
- drmModeAtomicFree(req);
+ sym_drmModeAtomicFree(req);
return ret;
}
#endif
@@ -108,9 +108,9 @@ EAPI Ecore_Drm2_Fb *
ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned int format)
{
Ecore_Drm2_Fb *fb;
- struct drm_mode_create_dumb carg;
- struct drm_mode_destroy_dumb darg;
- struct drm_mode_map_dumb marg;
+ drm_mode_create_dumb carg;
+ drm_mode_destroy_dumb darg;
+ drm_mode_map_dumb marg;
int ret;
EINA_SAFETY_ON_TRUE_RETURN_VAL((fd < 0), NULL);
@@ -125,12 +125,12 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
fb->depth = depth;
fb->format = format;
- memset(&carg, 0, sizeof(struct drm_mode_create_dumb));
+ memset(&carg, 0, sizeof(drm_mode_create_dumb));
carg.bpp = bpp;
carg.width = width;
carg.height = height;
- ret = drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &carg);
+ ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &carg);
if (ret) goto err;
fb->hdl = carg.handle;
@@ -140,8 +140,8 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
if (!_fb2_create(fb))
{
ret =
- drmModeAddFB(fd, width, height, depth, bpp,
- fb->stride, fb->hdl, &fb->id);
+ sym_drmModeAddFB(fd, width, height, depth, bpp,
+ fb->stride, fb->hdl, &fb->id);
if (ret)
{
ERR("Could not add framebuffer: %m");
@@ -149,9 +149,9 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
}
}
- memset(&marg, 0, sizeof(struct drm_mode_map_dumb));
+ memset(&marg, 0, sizeof(drm_mode_map_dumb));
marg.handle = fb->hdl;
- ret = drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
+ ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
if (ret)
{
ERR("Could not map framebuffer: %m");
@@ -168,11 +168,11 @@ ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned
return fb;
map_err:
- drmModeRmFB(fd, fb->id);
+ sym_drmModeRmFB(fd, fb->id);
add_err:
- memset(&darg, 0, sizeof(struct drm_mode_destroy_dumb));
+ memset(&darg, 0, sizeof(drm_mode_destroy_dumb));
darg.handle = fb->hdl;
- drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
+ sym_drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
err:
free(fb);
return NULL;
@@ -181,7 +181,7 @@ err:
EAPI Ecore_Drm2_Fb *
ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride, void *bo)
{
- struct drm_mode_map_dumb marg;
+ drm_mode_map_dumb marg;
Ecore_Drm2_Fb *fb;
int ret;
@@ -205,8 +205,8 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi
if (!_fb2_create(fb))
{
- if (drmModeAddFB(fd, width, height, depth, bpp,
- fb->stride, fb->hdl, &fb->id))
+ if (sym_drmModeAddFB(fd, width, height, depth, bpp,
+ fb->stride, fb->hdl, &fb->id))
{
ERR("Could not add framebuffer: %m");
goto err;
@@ -214,9 +214,9 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi
}
/* mmap it if we can so screenshots are easy */
- memset(&marg, 0, sizeof(struct drm_mode_map_dumb));
+ memset(&marg, 0, sizeof(drm_mode_map_dumb));
marg.handle = fb->hdl;
- ret = drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
+ ret = sym_drmIoctl(fd, DRM_IOCTL_MODE_MAP_DUMB, &marg);
if (!ret)
{
fb->mmap = mmap(NULL, fb->size, PROT_WRITE, MAP_SHARED, fd, marg.offset);
@@ -236,15 +236,15 @@ ecore_drm2_fb_destroy(Ecore_Drm2_Fb *fb)
if (fb->mmap) munmap(fb->mmap, fb->size);
- if (fb->id) drmModeRmFB(fb->fd, fb->id);
+ if (fb->id) sym_drmModeRmFB(fb->fd, fb->id);
if (!fb->gbm)
{
- struct drm_mode_destroy_dumb darg;
+ drm_mode_destroy_dumb darg;
- memset(&darg, 0, sizeof(struct drm_mode_destroy_dumb));
+ memset(&darg, 0, sizeof(drm_mode_destroy_dumb));
darg.handle = fb->hdl;
- drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
+ sym_drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg);
}
free(fb);
@@ -291,7 +291,7 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle *rects, unsigned int count
clip[i].y2 = rects[i].h;
}
- ret = drmModeDirtyFB(fb->fd, fb->id, clip, count);
+ ret = sym_drmModeDirtyFB(fb->fd, fb->id, clip, count);
if ((ret) && (ret == -EINVAL))
WRN("Could not mark framebuffer as dirty: %m");
#endif
@@ -397,9 +397,9 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
(output->current->stride != fb->stride))
{
ret =
- drmModeSetCrtc(fb->fd, output->crtc_id, fb->id,
- output->x, output->y, &output->conn_id, 1,
- &output->current_mode->info);
+ sym_drmModeSetCrtc(fb->fd, output->crtc_id, fb->id,
+ output->x, output->y, &output->conn_id, 1,
+ &output->current_mode->info);
if (ret)
{
ERR("Failed to set Mode %dx%d for Output %s: %m",
@@ -420,8 +420,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
}
ret =
- drmModePageFlip(fb->fd, output->crtc_id, fb->id,
- DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
+ sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id,
+ DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
if ((ret < 0) && (errno != EBUSY))
{
DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index fe3db163e7..b39c99fc72 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -220,14 +220,14 @@ _output_edid_find(Ecore_Drm2_Output *output, const drmModeConnector *conn)
for (; i < conn->count_props && !blob; i++)
{
- if (!(prop = drmModeGetProperty(output->fd, conn->props[i])))
+ if (!(prop = sym_drmModeGetProperty(output->fd, conn->props[i])))
continue;
if ((prop->flags & DRM_MODE_PROP_BLOB) &&
(!strcmp(prop->name, "EDID")))
{
- blob = drmModeGetPropertyBlob(output->fd, conn->prop_values[i]);
+ blob = sym_drmModeGetPropertyBlob(output->fd, conn->prop_values[i]);
}
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
if (blob) break;
}
@@ -246,7 +246,7 @@ _output_edid_find(Ecore_Drm2_Output *output, const drmModeConnector *conn)
eina_stringshare_replace(&output->serial, output->edid.serial);
}
- drmModeFreePropertyBlob(blob);
+ sym_drmModeFreePropertyBlob(blob);
}
static int
@@ -267,11 +267,11 @@ _output_crtc_find(const drmModeRes *res, const drmModeConnector *conn, Ecore_Drm
for (j = 0; j < conn->count_encoders; j++)
{
- enc = drmModeGetEncoder(dev->fd, conn->encoders[j]);
+ enc = sym_drmModeGetEncoder(dev->fd, conn->encoders[j]);
if (!enc) continue;
crtc = enc->crtc_id;
- drmModeFreeEncoder(enc);
+ sym_drmModeFreeEncoder(enc);
for (i = 0; i < res->count_crtcs; i++)
if (crtc == res->crtcs[i])
@@ -343,14 +343,14 @@ _output_modes_create(Ecore_Drm2_Device *dev, Ecore_Drm2_Output *output, const dr
memset(&crtc_mode, 0, sizeof(crtc_mode));
- enc = drmModeGetEncoder(dev->fd, conn->encoder_id);
+ enc = sym_drmModeGetEncoder(dev->fd, conn->encoder_id);
if (enc)
{
- crtc = drmModeGetCrtc(dev->fd, enc->crtc_id);
- drmModeFreeEncoder(enc);
+ crtc = sym_drmModeGetCrtc(dev->fd, enc->crtc_id);
+ sym_drmModeFreeEncoder(enc);
if (!crtc) return;
if (crtc->mode_valid) crtc_mode = crtc->mode;
- drmModeFreeCrtc(crtc);
+ sym_drmModeFreeCrtc(crtc);
}
for (i = 0; i < conn->count_modes; i++)
@@ -397,12 +397,12 @@ _output_dpms_property_get(int fd, const drmModeConnector *conn)
for (; i < conn->count_props; i++)
{
- prop = drmModeGetProperty(fd, conn->props[i]);
+ prop = sym_drmModeGetProperty(fd, conn->props[i]);
if (!prop) continue;
if (!strcmp(prop->name, "DPMS")) return prop;
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
}
return NULL;
@@ -416,29 +416,29 @@ _output_dpms_atomic_set(Ecore_Drm2_Output *output, int level)
drmModeAtomicReq *req = NULL;
Eina_Bool ret = EINA_TRUE;
- req = drmModeAtomicAlloc();
+ req = sym_drmModeAtomicAlloc();
if (!req) return EINA_FALSE;
- drmModeAtomicSetCursor(req, 0);
+ sym_drmModeAtomicSetCursor(req, 0);
cstate = output->crtc_state;
- if (drmModeAtomicAddProperty(req, cstate->obj_id,
- cstate->active.id, level) < 0)
+ if (sym_drmModeAtomicAddProperty(req, cstate->obj_id,
+ cstate->active.id, level) < 0)
{
ERR("Failed to add connector property DPMS");
ret = EINA_FALSE;
goto err;
}
- if (drmModeAtomicCommit(output->fd, req, 0, NULL))
+ if (sym_drmModeAtomicCommit(output->fd, req, 0, NULL))
{
ERR("Could not set dpms property: %m");
ret = EINA_FALSE;
}
err:
- drmModeAtomicFree(req);
+ sym_drmModeAtomicFree(req);
return ret;
}
@@ -736,7 +736,7 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne
output->connected = (conn->connection == DRM_MODE_CONNECTED);
- output->ocrtc = drmModeGetCrtc(dev->fd, output->crtc_id);
+ output->ocrtc = sym_drmModeGetCrtc(dev->fd, output->crtc_id);
#ifdef HAVE_ATOMIC_DRM
if (_ecore_drm2_use_atomic)
@@ -801,12 +801,12 @@ _outputs_update(Ecore_Drm2_Device *dev)
uint32_t connected = 0, disconnected = 0;
int i = 0, x = 0, y = 0;
- res = drmModeGetResources(dev->fd);
+ res = sym_drmModeGetResources(dev->fd);
if (!res) return;
for (i = 0; i < res->count_connectors; i++)
{
- conn = drmModeGetConnector(dev->fd, res->connectors[i]);
+ conn = sym_drmModeGetConnector(dev->fd, res->connectors[i]);
if (!conn) continue;
if (conn->connection != DRM_MODE_CONNECTED) goto next;
@@ -831,10 +831,10 @@ _outputs_update(Ecore_Drm2_Device *dev)
}
next:
- drmModeFreeConnector(conn);
+ sym_drmModeFreeConnector(conn);
}
- drmModeFreeResources(res);
+ sym_drmModeFreeResources(res);
disconnected = (dev->alloc.conn & ~connected);
if (disconnected)
@@ -890,7 +890,7 @@ _output_destroy(Ecore_Drm2_Device *dev, Ecore_Drm2_Output *output)
EINA_LIST_FREE(output->modes, mode)
{
if (mode->id)
- drmModeDestroyPropertyBlob(output->fd, mode->id);
+ sym_drmModeDestroyPropertyBlob(output->fd, mode->id);
free(mode);
}
@@ -903,7 +903,7 @@ _output_destroy(Ecore_Drm2_Device *dev, Ecore_Drm2_Output *output)
eina_stringshare_del(output->model);
eina_stringshare_del(output->serial);
- drmModeFreeProperty(output->dpms);
+ sym_drmModeFreeProperty(output->dpms);
free(output->edid.blob);
free(output);
@@ -920,7 +920,7 @@ ecore_drm2_outputs_create(Ecore_Drm2_Device *device)
EINA_SAFETY_ON_NULL_RETURN_VAL(device, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL((device->fd < 0), EINA_FALSE);
- res = drmModeGetResources(device->fd);
+ res = sym_drmModeGetResources(device->fd);
if (!res) return EINA_FALSE;
device->crtcs = calloc(res->count_crtcs, sizeof(uint32_t));
@@ -936,7 +936,7 @@ ecore_drm2_outputs_create(Ecore_Drm2_Device *device)
for (i = 0; i < res->count_connectors; i++)
{
- conn = drmModeGetConnector(device->fd, res->connectors[i]);
+ conn = sym_drmModeGetConnector(device->fd, res->connectors[i]);
if (!conn) continue;
if (!_output_create(device, res, conn, x, y, &w, EINA_FALSE))
@@ -945,12 +945,12 @@ ecore_drm2_outputs_create(Ecore_Drm2_Device *device)
x += w;
next:
- drmModeFreeConnector(conn);
+ sym_drmModeFreeConnector(conn);
}
if (eina_list_count(device->outputs) < 1) goto err;
- drmModeFreeResources(res);
+ sym_drmModeFreeResources(res);
events = (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE |
EEZE_UDEV_EVENT_CHANGE);
@@ -962,7 +962,7 @@ next:
return EINA_TRUE;
err:
- drmModeFreeResources(res);
+ sym_drmModeFreeResources(res);
return EINA_FALSE;
}
@@ -995,22 +995,22 @@ ecore_drm2_output_dpms_get(Ecore_Drm2_Output *output)
EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1);
props =
- drmModeObjectGetProperties(output->fd, output->conn_id,
- DRM_MODE_OBJECT_CONNECTOR);
+ sym_drmModeObjectGetProperties(output->fd, output->conn_id,
+ DRM_MODE_OBJECT_CONNECTOR);
if (!props) return -1;
for (i = 0; i < props->count_props; i++)
{
- prop = drmModeGetProperty(output->fd, props->props[i]);
+ prop = sym_drmModeGetProperty(output->fd, props->props[i]);
if (!prop) continue;
if (!strcmp(prop->name, "DPMS"))
val = props->prop_values[i];
- drmModeFreeProperty(prop);
+ sym_drmModeFreeProperty(prop);
}
- drmModeFreeObjectProperties(props);
+ sym_drmModeFreeObjectProperties(props);
return val;
}
@@ -1026,8 +1026,8 @@ ecore_drm2_output_dpms_set(Ecore_Drm2_Output *output, int level)
_output_dpms_atomic_set(output, level);
else
#endif
- drmModeConnectorSetProperty(output->fd, output->conn_id,
- output->dpms->prop_id, level);
+ sym_drmModeConnectorSetProperty(output->fd, output->conn_id,
+ output->dpms->prop_id, level);
}
EAPI char *
@@ -1137,13 +1137,13 @@ ecore_drm2_output_crtc_size_get(Ecore_Drm2_Output *output, int *w, int *h)
EINA_SAFETY_ON_NULL_RETURN(output);
- crtc = drmModeGetCrtc(output->fd, output->crtc_id);
+ crtc = sym_drmModeGetCrtc(output->fd, output->crtc_id);
if (!crtc) return;
if (w) *w = crtc->width;
if (h) *h = crtc->height;
- drmModeFreeCrtc(crtc);
+ sym_drmModeFreeCrtc(crtc);
}
EAPI Eina_Bool
@@ -1251,11 +1251,11 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
if (mode)
{
if (mode->id)
- drmModeDestroyPropertyBlob(output->fd, mode->id);
+ sym_drmModeDestroyPropertyBlob(output->fd, mode->id);
ret =
- drmModeCreatePropertyBlob(output->fd, &mode->info,
- sizeof(drmModeModeInfo), &mode->id);
+ sym_drmModeCreatePropertyBlob(output->fd, &mode->info,
+ sizeof(drmModeModeInfo), &mode->id);
if (ret < 0)
{
ERR("Failed to create Mode Property Blob");
@@ -1263,10 +1263,10 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
}
}
- req = drmModeAtomicAlloc();
+ req = sym_drmModeAtomicAlloc();
if (!req) return EINA_FALSE;
- drmModeAtomicSetCursor(req, 0);
+ sym_drmModeAtomicSetCursor(req, 0);
if (mode)
{
@@ -1276,8 +1276,8 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
else
cstate->active.value = 0;
- ret = drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
- cstate->mode.value);
+ ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
+ cstate->mode.value);
if (ret < 0)
{
ERR("Could not add atomic property");
@@ -1285,8 +1285,8 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
goto err;
}
- ret = drmModeAtomicAddProperty(req, cstate->obj_id,
- cstate->active.id, cstate->active.value);
+ ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id,
+ cstate->active.id, cstate->active.value);
if (ret < 0)
{
ERR("Could not add atomic property");
@@ -1294,8 +1294,8 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
goto err;
}
- ret = drmModeAtomicCommit(output->fd, req, DRM_MODE_ATOMIC_ALLOW_MODESET,
- output->user_data);
+ ret = sym_drmModeAtomicCommit(output->fd, req, DRM_MODE_ATOMIC_ALLOW_MODESET,
+ output->user_data);
if (ret < 0)
{
ERR("Failed to commit atomic Mode: %m");
@@ -1306,7 +1306,7 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode)
ret = EINA_TRUE;
err:
- drmModeAtomicFree(req);
+ sym_drmModeAtomicFree(req);
return ret;
}
#endif
@@ -1340,8 +1340,8 @@ ecore_drm2_output_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mo
else
buffer = output->ocrtc->buffer_id;
- if (drmModeSetCrtc(output->fd, output->crtc_id, buffer,
- x, y, &output->conn_id, 1, &mode->info) < 0)
+ if (sym_drmModeSetCrtc(output->fd, output->crtc_id, buffer,
+ x, y, &output->conn_id, 1, &mode->info) < 0)
{
ERR("Failed to set Mode %dx%d for Output %s: %m",
mode->width, mode->height, output->name);
@@ -1350,8 +1350,8 @@ ecore_drm2_output_mode_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mo
}
else
{
- if (drmModeSetCrtc(output->fd, output->crtc_id, 0,
- 0, 0, 0, 0, NULL) < 0)
+ if (sym_drmModeSetCrtc(output->fd, output->crtc_id, 0,
+ 0, 0, 0, 0, NULL) < 0)
{
ERR("Failed to turn off Output %s: %m", output->name);
ret = EINA_FALSE;
@@ -1427,17 +1427,17 @@ ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, unsigned int crtc
EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL((output->fd < 0), EINA_FALSE);
- res = drmModeGetResources(output->fd);
+ res = sym_drmModeGetResources(output->fd);
if (!res) return EINA_FALSE;
for (; i < res->count_connectors; i++)
{
- conn = drmModeGetConnector(output->fd, res->connectors[i]);
+ conn = sym_drmModeGetConnector(output->fd, res->connectors[i]);
if (!conn) continue;
for (j = 0; j < conn->count_encoders; j++)
{
- enc = drmModeGetEncoder(output->fd, conn->encoders[j]);
+ enc = sym_drmModeGetEncoder(output->fd, conn->encoders[j]);
if (!enc) continue;
if (enc->crtc_id != crtc) goto next;
@@ -1456,15 +1456,15 @@ ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, unsigned int crtc
}
next:
- drmModeFreeEncoder(enc);
+ sym_drmModeFreeEncoder(enc);
if (ret) break;
}
- drmModeFreeConnector(conn);
+ sym_drmModeFreeConnector(conn);
if (ret) break;
}
- drmModeFreeResources(res);
+ sym_drmModeFreeResources(res);
return ret;
}