Commit 7580b3c0 authored by Daniel Stone's avatar Daniel Stone

compositor-drm: Move FB handling to a separate file

Move everything to do with creation, destruction, and reference handling
of drm_fbs to a new file.
Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
parent 4c2fc705
......@@ -508,6 +508,25 @@ drm_output_find_by_crtc(struct drm_backend *b, uint32_t crtc_id);
struct drm_head *
drm_head_find_by_connector(struct drm_backend *backend, uint32_t connector_id);
static inline bool
drm_view_transform_supported(struct weston_view *ev, struct weston_output *output)
{
struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport;
/* This will incorrectly disallow cases where the combination of
* buffer and view transformations match the output transform.
* Fixing this requires a full analysis of the transformation
* chain. */
if (ev->transform.enabled &&
ev->transform.matrix.type >= WESTON_MATRIX_TRANSFORM_ROTATE)
return false;
if (viewport->buffer.transform != output->transform)
return false;
return true;
}
int
drm_mode_ensure_blob(struct drm_backend *backend, struct drm_mode *mode);
......@@ -582,3 +601,17 @@ void
drm_output_state_free(struct drm_output_state *state);
void
drm_pending_state_free(struct drm_pending_state *pending_state);
struct drm_fb *
drm_fb_ref(struct drm_fb *fb);
void
drm_fb_unref(struct drm_fb *fb);
struct drm_fb *
drm_fb_create_dumb(struct drm_backend *b, int width, int height,
uint32_t format);
struct drm_fb *
drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_backend *backend,
bool is_opaque, enum drm_fb_type type);
struct drm_fb *
drm_fb_get_from_view(struct drm_output_state *state, struct weston_view *ev);
This diff is collapsed.
This diff is collapsed.
......@@ -21,6 +21,7 @@ config_h.set('BUILD_DRM_COMPOSITOR', '1')
srcs_drm = [
'drm.c',
'fb.c',
'modes.c',
'kms.c',
linux_dmabuf_unstable_v1_protocol_c,
......
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