ecore_drm2: Rename some variables in the structures to avoid confusion

While I hate CamelCase, using drmCrtc, drmConn, etc makes it easier
when reading the code to distinguish what we are operating on/with.
This commit is contained in:
Christopher Michael 2022-09-22 11:50:52 -04:00
parent 1e2517cf07
commit eb4940d94e
5 changed files with 23 additions and 23 deletions

View File

@ -152,7 +152,7 @@ _ecore_drm2_connector_create(Ecore_Drm2_Device *dev, drmModeConnector *conn, uin
c->id = id;
c->fd = dev->fd;
c->conn = conn;
c->drmConn = conn;
c->type = conn->connector_type;
/* check if this connector is a writeback */
@ -221,7 +221,7 @@ _ecore_drm2_connectors_destroy(Ecore_Drm2_Device *dev)
EINA_LIST_FREE(dev->conns, conn)
{
if (conn->thread) ecore_thread_cancel(conn->thread);
if (conn->conn) sym_drmModeFreeConnector(conn->conn);
if (conn->drmConn) sym_drmModeFreeConnector(conn->drmConn);
free(conn->state);
free(conn);
}

View File

@ -25,7 +25,7 @@ _ecore_drm2_crtc_state_fill(Ecore_Drm2_Crtc *crtc)
}
cstate = crtc->state;
cstate->obj_id = crtc->dcrtc->crtc_id;
cstate->obj_id = crtc->drmCrtc->crtc_id;
/* get the properties of this crtc from drm */
oprops =
@ -144,7 +144,7 @@ _ecore_drm2_crtc_create(Ecore_Drm2_Device *dev, drmModeCrtcPtr dcrtc, uint32_t p
crtc->id = dcrtc->crtc_id;
crtc->fd = dev->fd;
crtc->pipe = pipe;
crtc->dcrtc = dcrtc;
crtc->drmCrtc = dcrtc;
/* add this crtc to the list */
dev->crtcs = eina_list_append(dev->crtcs, crtc);
@ -204,7 +204,7 @@ _ecore_drm2_crtcs_destroy(Ecore_Drm2_Device *dev)
EINA_LIST_FREE(dev->crtcs, crtc)
{
if (crtc->thread) ecore_thread_cancel(crtc->thread);
if (crtc->dcrtc) sym_drmModeFreeCrtc(crtc->dcrtc);
if (crtc->drmCrtc) sym_drmModeFreeCrtc(crtc->drmCrtc);
free(crtc->state);
free(crtc);
}

View File

@ -26,7 +26,7 @@ _ecore_drm2_display_name_get(Ecore_Drm2_Connector *conn)
else
type = "UNKNOWN";
snprintf(name, sizeof(name), "%s-%d", type, conn->conn->connector_type_id);
snprintf(name, sizeof(name), "%s-%d", type, conn->drmConn->connector_type_id);
return strdup(name);
}
@ -128,7 +128,7 @@ _ecore_drm2_display_state_debug(Ecore_Drm2_Display *disp)
DBG("\tSerial: %s", disp->serial);
DBG("\tCrtc: %d", disp->crtc->id);
DBG("\tCrtc Pos: %d %d", disp->crtc->dcrtc->x, disp->crtc->dcrtc->y);
DBG("\tCrtc Pos: %d %d", disp->crtc->drmCrtc->x, disp->crtc->drmCrtc->y);
DBG("\tConnector: %d", disp->conn->id);
if (disp->backlight.path)
@ -262,14 +262,14 @@ _ecore_drm2_display_modes_get(Ecore_Drm2_Display *disp)
memset(&crtc_mode, 0, sizeof(crtc_mode));
if (disp->crtc->dcrtc->mode_valid)
crtc_mode = disp->crtc->dcrtc->mode;
if (disp->crtc->drmCrtc->mode_valid)
crtc_mode = disp->crtc->drmCrtc->mode;
/* loop through connector modes and try to create mode */
for (; i < disp->conn->conn->count_modes; i++)
for (; i < disp->conn->drmConn->count_modes; i++)
{
dmode =
_ecore_drm2_display_mode_create(&disp->conn->conn->modes[i]);
_ecore_drm2_display_mode_create(&disp->conn->drmConn->modes[i]);
if (!dmode) continue;
/* append mode to display mode list */
@ -297,11 +297,11 @@ _ecore_drm2_display_state_fill(Ecore_Drm2_Display *disp)
_ecore_drm2_display_edid_get(disp);
/* get physical dimensions */
disp->pw = disp->conn->conn->mmWidth;
disp->ph = disp->conn->conn->mmHeight;
disp->pw = disp->conn->drmConn->mmWidth;
disp->ph = disp->conn->drmConn->mmHeight;
/* get subpixel */
switch (disp->conn->conn->subpixel)
switch (disp->conn->drmConn->subpixel)
{
case DRM_MODE_SUBPIXEL_NONE:
disp->subpixel = 1;
@ -331,10 +331,10 @@ _ecore_drm2_display_state_fill(Ecore_Drm2_Display *disp)
_ecore_drm2_display_modes_get(disp);
/* get gamma from crtc */
disp->gamma = disp->crtc->dcrtc->gamma_size;
disp->gamma = disp->crtc->drmCrtc->gamma_size;
/* get connected state */
disp->connected = (disp->conn->conn->connection == DRM_MODE_CONNECTED);
disp->connected = (disp->conn->drmConn->connection == DRM_MODE_CONNECTED);
}
static void
@ -385,7 +385,7 @@ _ecore_drm2_displays_create(Ecore_Drm2_Device *dev)
drmModeCrtc *dcrtc;
/* try to get the encoder from drm */
encoder = sym_drmModeGetEncoder(dev->fd, c->conn->encoder_id);
encoder = sym_drmModeGetEncoder(dev->fd, c->drmConn->encoder_id);
if (!encoder) continue;
/* try to get the crtc from drm */

View File

@ -38,7 +38,7 @@ _ecore_drm2_plane_state_fill(Ecore_Drm2_Plane *plane)
return;
}
p = plane->dplane;
p = plane->drmPlane;
pstate = plane->state;
pstate->obj_id = plane->id;
@ -205,7 +205,7 @@ _ecore_drm2_plane_create(Ecore_Drm2_Device *dev, drmModePlanePtr p, uint32_t ind
plane->fd = dev->fd;
plane->id = index;
plane->dplane = p;
plane->drmPlane = p;
/* append this plane to the list */
dev->planes = eina_list_append(dev->planes, plane);
@ -256,7 +256,7 @@ _ecore_drm2_planes_destroy(Ecore_Drm2_Device *dev)
EINA_LIST_FREE(dev->planes, plane)
{
if (plane->dplane) sym_drmModeFreePlane(plane->dplane);
if (plane->drmPlane) sym_drmModeFreePlane(plane->drmPlane);
free(plane->state);
free(plane);
}

View File

@ -159,7 +159,7 @@ struct _Ecore_Drm2_Plane
int fd;
uint32_t id;
drmModePlanePtr dplane;
drmModePlanePtr drmPlane;
Ecore_Drm2_Plane_State *state;
@ -216,7 +216,7 @@ struct _Ecore_Drm2_Connector
uint32_t type;
int fd;
drmModeConnector *conn;
drmModeConnector *drmConn;
Ecore_Drm2_Connector_State *state;
@ -231,7 +231,7 @@ struct _Ecore_Drm2_Crtc
uint32_t pipe;
int fd;
drmModeCrtcPtr dcrtc;
drmModeCrtcPtr drmCrtc;
/* TODO: store FBs */