Commit 2af7f106 authored by Benjamin Franzke's avatar Benjamin Franzke 😀 Committed by Kristian H. Kristensen

compositor: Remove wlsc_drm

parent 84290d02
......@@ -37,6 +37,9 @@ struct drm_compositor {
struct udev *udev;
struct wl_event_source *drm_source;
struct {
int fd;
} drm;
struct tty *tty;
};
......@@ -67,7 +70,7 @@ drm_compositor_present(struct wlsc_compositor *ec)
output->rbo[output->current]);
glFlush();
drmModePageFlip(c->base.drm.fd, output->crtc_id,
drmModePageFlip(c->drm.fd, output->crtc_id,
output->fb_id[output->current ^ 1],
DRM_MODE_PAGE_FLIP_EVENT, output);
}
......@@ -116,8 +119,8 @@ init_egl(struct drm_compositor *ec, struct udev_device *device)
return -1;
}
ec->base.drm.fd = fd;
ec->base.display = eglGetDRMDisplayMESA(ec->base.drm.fd);
ec->drm.fd = fd;
ec->base.display = eglGetDRMDisplayMESA(ec->drm.fd);
if (ec->base.display == NULL) {
fprintf(stderr, "failed to create display\n");
return -1;
......@@ -191,7 +194,7 @@ create_output_for_connector(struct drm_compositor *ec,
else
mode = &builtin_1024x768;
encoder = drmModeGetEncoder(ec->base.drm.fd, connector->encoders[0]);
encoder = drmModeGetEncoder(ec->drm.fd, connector->encoders[0]);
if (encoder == NULL) {
fprintf(stderr, "No encoder for connector.\n");
return -1;
......@@ -229,7 +232,7 @@ create_output_for_connector(struct drm_compositor *ec,
eglExportDRMImageMESA(ec->base.display, output->image[i],
NULL, &handle, &stride);
ret = drmModeAddFB(ec->base.drm.fd,
ret = drmModeAddFB(ec->drm.fd,
output->base.width, output->base.height,
32, 32, stride, handle, &output->fb_id[i]);
if (ret) {
......@@ -243,7 +246,7 @@ create_output_for_connector(struct drm_compositor *ec,
GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER,
output->rbo[output->current]);
ret = drmModeSetCrtc(ec->base.drm.fd, output->crtc_id,
ret = drmModeSetCrtc(ec->drm.fd, output->crtc_id,
output->fb_id[output->current ^ 1], 0, 0,
&output->connector_id, 1, &output->mode);
if (ret) {
......@@ -263,14 +266,14 @@ create_outputs(struct drm_compositor *ec, int option_connector)
drmModeRes *resources;
int i;
resources = drmModeGetResources(ec->base.drm.fd);
resources = drmModeGetResources(ec->drm.fd);
if (!resources) {
fprintf(stderr, "drmModeGetResources failed\n");
return -1;
}
for (i = 0; i < resources->count_connectors; i++) {
connector = drmModeGetConnector(ec->base.drm.fd, resources->connectors[i]);
connector = drmModeGetConnector(ec->drm.fd, resources->connectors[i]);
if (connector == NULL)
continue;
......@@ -368,7 +371,7 @@ drm_compositor_create(struct wl_display *display, int connector)
loop = wl_display_get_event_loop(ec->base.wl_display);
ec->drm_source =
wl_event_loop_add_fd(loop, ec->base.drm.fd,
wl_event_loop_add_fd(loop, ec->drm.fd,
WL_EVENT_READABLE, on_drm_input, ec);
ec->tty = tty_create(&ec->base);
......
......@@ -74,12 +74,6 @@ struct wlsc_input_device {
struct wl_selection *selection;
};
struct wlsc_drm {
struct wl_object object;
int fd;
char *filename;
};
struct wlsc_shm {
struct wl_object object;
};
......@@ -87,7 +81,6 @@ struct wlsc_shm {
struct wlsc_compositor {
struct wl_compositor compositor;
struct wlsc_drm drm;
struct wlsc_shm shm;
EGLDisplay display;
EGLContext context;
......@@ -224,8 +217,6 @@ wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
void
wlsc_input_device_init(struct wlsc_input_device *device,
struct wlsc_compositor *ec);
int
wlsc_drm_init(struct wlsc_compositor *ec, int fd, const char *filename);
int
wlsc_shm_init(struct wlsc_compositor *ec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment