backend-drm: get handle in gbm specific code

Get GBM BO handle in GBM specific code. This allows to compile
drm_output_set_cursor without GBM.

Signed-off-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
Stefan Agner 2019-07-08 00:42:05 +02:00
parent 5dd3e9996a
commit 974390a5fa
3 changed files with 4 additions and 4 deletions

View File

@ -445,6 +445,7 @@ struct drm_output {
int disable_pending;
int dpms_off_pending;
uint32_t gbm_cursor_handle[2];
struct drm_fb *gbm_cursor_fb[2];
struct drm_plane *cursor_plane;
struct weston_view *cursor_view;

View File

@ -1307,6 +1307,7 @@ drm_output_init_cursor_egl(struct drm_output *output, struct drm_backend *b)
gbm_bo_destroy(bo);
goto err;
}
output->gbm_cursor_handle[i] = gbm_bo_get_handle(bo).s32;
}
return 0;

View File

@ -514,8 +514,7 @@ drm_output_set_cursor(struct drm_output_state *output_state)
struct drm_backend *b = to_drm_backend(output->base.compositor);
struct drm_plane *plane = output->cursor_plane;
struct drm_plane_state *state;
int handle;
struct gbm_bo *bo;
uint32_t handle;
if (!plane)
return;
@ -534,9 +533,8 @@ drm_output_set_cursor(struct drm_output_state *output_state)
assert(state->fb == output->gbm_cursor_fb[output->current_cursor]);
assert(!plane->state_cur->output || plane->state_cur->output == output);
handle = output->gbm_cursor_handle[output->current_cursor];
if (plane->state_cur->fb != state->fb) {
bo = state->fb->bo;
handle = gbm_bo_get_handle(bo).s32;
if (drmModeSetCursor(b->drm.fd, output->crtc_id, handle,
b->cursor_width, b->cursor_height)) {
weston_log("failed to set cursor: %s\n",