From 9b984253e2b878128d2042836a8c86228700b1ee Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sat, 21 Oct 2017 14:48:58 +1300 Subject: Move egl.h to render/egl.h --- include/backend/drm/drm.h | 2 +- include/backend/wayland.h | 2 +- include/backend/x11.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include/backend') diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 6106a85a..7a0e43ea 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include "iface.h" diff --git a/include/backend/wayland.h b/include/backend/wayland.h index 508a7f52..88aeabca 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/backend/x11.h b/include/backend/x11.h index b4284b63..f5ec56bc 100644 --- a/include/backend/x11.h +++ b/include/backend/x11.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include -- cgit v1.2.3 From 4ea84c5765b138153aa313f23288935192b75c42 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sat, 21 Oct 2017 17:35:37 +1300 Subject: Remove unnecesary wlr_renderers --- backend/drm/drm.c | 12 ++---------- include/backend/drm/drm.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'include/backend') diff --git a/backend/drm/drm.c b/backend/drm/drm.c index ff4dc7f6..0e898d3f 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -177,9 +177,6 @@ void wlr_drm_resources_free(struct wlr_drm_backend *drm) { if (plane->wlr_tex) { wlr_texture_destroy(plane->wlr_tex); } - if (plane->wlr_rend) { - wlr_renderer_destroy(plane->wlr_rend); - } } free(drm->crtcs); @@ -525,12 +522,7 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, // TODO the image needs to be rotated depending on the output rotation - plane->wlr_rend = wlr_gles2_renderer_create(&drm->backend); - if (!plane->wlr_rend) { - return false; - } - - plane->wlr_tex = wlr_render_texture_create(plane->wlr_rend); + plane->wlr_tex = wlr_render_texture_create(plane->surf.renderer->wlr_rend); if (!plane->wlr_tex) { return false; } @@ -595,7 +587,7 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, float matrix[16]; wlr_texture_get_matrix(plane->wlr_tex, &matrix, &plane->matrix, 0, 0); - wlr_render_with_matrix(plane->wlr_rend, plane->wlr_tex, &matrix); + wlr_render_with_matrix(plane->surf.renderer->wlr_rend, plane->wlr_tex, &matrix); glFinish(); glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, bo_stride); diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 7a0e43ea..2ef3cf92 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -30,7 +30,6 @@ struct wlr_drm_plane { // Only used by cursor float matrix[16]; - struct wlr_renderer *wlr_rend; struct wlr_texture *wlr_tex; struct gbm_bo *cursor_bo; -- cgit v1.2.3 From bdeffad7e5cacd2d1e27ddc0d44b3d9e2c19587d Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sat, 21 Oct 2017 17:44:49 +1300 Subject: Remove drm field from wlr_drm_connector --- backend/drm/drm.c | 20 ++++++++++---------- include/backend/drm/drm.h | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'include/backend') diff --git a/backend/drm/drm.c b/backend/drm/drm.c index b3057166..04d7ea77 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -190,7 +190,7 @@ static void wlr_drm_connector_make_current(struct wlr_output *output) { static void wlr_drm_connector_swap_buffers(struct wlr_output *output) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; struct wlr_drm_crtc *crtc = conn->crtc; struct wlr_drm_plane *plane = crtc->primary; @@ -213,7 +213,8 @@ static void wlr_drm_connector_swap_buffers(struct wlr_output *output) { static void wlr_drm_connector_set_gamma(struct wlr_output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - drmModeCrtcSetGamma(conn->drm->fd, conn->crtc->id, size, r, g, b); + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; + drmModeCrtcSetGamma(drm->fd, conn->crtc->id, size, r, g, b); } static uint16_t wlr_drm_connector_get_gamma_size(struct wlr_output *output) { @@ -227,7 +228,7 @@ void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) { return; } - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend; struct wlr_drm_crtc *crtc = conn->crtc; struct wlr_drm_plane *plane = crtc->primary; @@ -250,7 +251,7 @@ static void wlr_drm_connector_enable(struct wlr_output *output, bool enable) { return; } - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; drm->iface->conn_enable(drm, conn, enable); if (enable) { @@ -403,7 +404,7 @@ error_conn: static bool wlr_drm_connector_set_mode(struct wlr_output *output, struct wlr_output_mode *mode) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; wlr_log(L_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", conn->output.name, mode->width, mode->height, mode->refresh); @@ -469,7 +470,7 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y, bool update_pixels) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; struct wlr_drm_renderer *renderer = &drm->renderer; struct wlr_drm_crtc *crtc = conn->crtc; @@ -604,7 +605,7 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, static bool wlr_drm_connector_move_cursor(struct wlr_output *output, int x, int y) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; int width, height, tmp; wlr_output_effective_resolution(output, &width, &height); @@ -714,7 +715,6 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) { wlr_conn); - wlr_conn->drm = drm; wlr_conn->state = WLR_DRM_CONN_DISCONNECTED; wlr_conn->id = drm_conn->connector_id; @@ -820,7 +820,7 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) { static void page_flip_handler(int fd, unsigned seq, unsigned tv_sec, unsigned tv_usec, void *user) { struct wlr_drm_connector *conn = user; - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend; conn->pageflip_pending = false; if (conn->state != WLR_DRM_CONN_CONNECTED) { @@ -891,7 +891,7 @@ void wlr_drm_connector_cleanup(struct wlr_drm_connector *conn) { return; } - struct wlr_drm_backend *drm = conn->drm; + struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend; switch (conn->state) { case WLR_DRM_CONN_CONNECTED: diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 2ef3cf92..b0f5838e 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -112,7 +112,6 @@ struct wlr_drm_mode { struct wlr_drm_connector { struct wlr_output output; - struct wlr_drm_backend *drm; enum wlr_drm_connector_state state; uint32_t id; -- cgit v1.2.3