Commit bdd96472 authored by Maxime Ripard's avatar Maxime Ripard

drm/vc4: crtc: Make state functions public

We'll need the CRTC state related functions to be exported so that we can
reuse them for the TXP.
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/658f40aa01d7a45cbf6feebfc3dc6549f100d110.1591882579.git-series.maxime@cerno.tech
parent 8175287b
...@@ -184,7 +184,7 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc, ...@@ -184,7 +184,7 @@ static bool vc4_crtc_get_scanout_position(struct drm_crtc *crtc,
return ret; return ret;
} }
static void vc4_crtc_destroy(struct drm_crtc *crtc) void vc4_crtc_destroy(struct drm_crtc *crtc)
{ {
drm_crtc_cleanup(crtc); drm_crtc_cleanup(crtc);
} }
...@@ -697,11 +697,11 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, ...@@ -697,11 +697,11 @@ static int vc4_async_page_flip(struct drm_crtc *crtc,
return 0; return 0;
} }
static int vc4_page_flip(struct drm_crtc *crtc, int vc4_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb, struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event, struct drm_pending_vblank_event *event,
uint32_t flags, uint32_t flags,
struct drm_modeset_acquire_ctx *ctx) struct drm_modeset_acquire_ctx *ctx)
{ {
if (flags & DRM_MODE_PAGE_FLIP_ASYNC) if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
return vc4_async_page_flip(crtc, fb, event, flags); return vc4_async_page_flip(crtc, fb, event, flags);
...@@ -709,7 +709,7 @@ static int vc4_page_flip(struct drm_crtc *crtc, ...@@ -709,7 +709,7 @@ static int vc4_page_flip(struct drm_crtc *crtc,
return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx); return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
} }
static struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)
{ {
struct vc4_crtc_state *vc4_state, *old_vc4_state; struct vc4_crtc_state *vc4_state, *old_vc4_state;
...@@ -725,8 +725,8 @@ static struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc) ...@@ -725,8 +725,8 @@ static struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)
return &vc4_state->base; return &vc4_state->base;
} }
static void vc4_crtc_destroy_state(struct drm_crtc *crtc, void vc4_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state) struct drm_crtc_state *state)
{ {
struct vc4_dev *vc4 = to_vc4_dev(crtc->dev); struct vc4_dev *vc4 = to_vc4_dev(crtc->dev);
struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(state); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(state);
...@@ -743,8 +743,7 @@ static void vc4_crtc_destroy_state(struct drm_crtc *crtc, ...@@ -743,8 +743,7 @@ static void vc4_crtc_destroy_state(struct drm_crtc *crtc,
drm_atomic_helper_crtc_destroy_state(crtc, state); drm_atomic_helper_crtc_destroy_state(crtc, state);
} }
static void void vc4_crtc_reset(struct drm_crtc *crtc)
vc4_crtc_reset(struct drm_crtc *crtc)
{ {
if (crtc->state) if (crtc->state)
vc4_crtc_destroy_state(crtc, crtc->state); vc4_crtc_destroy_state(crtc, crtc->state);
......
...@@ -775,6 +775,16 @@ void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo); ...@@ -775,6 +775,16 @@ void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo);
/* vc4_crtc.c */ /* vc4_crtc.c */
extern struct platform_driver vc4_crtc_driver; extern struct platform_driver vc4_crtc_driver;
void vc4_crtc_destroy(struct drm_crtc *crtc);
int vc4_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event,
uint32_t flags,
struct drm_modeset_acquire_ctx *ctx);
struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc);
void vc4_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void vc4_crtc_reset(struct drm_crtc *crtc);
void vc4_crtc_handle_vblank(struct vc4_crtc *crtc); void vc4_crtc_handle_vblank(struct vc4_crtc *crtc);
void vc4_crtc_txp_armed(struct drm_crtc_state *state); void vc4_crtc_txp_armed(struct drm_crtc_state *state);
void vc4_crtc_get_margins(struct drm_crtc_state *state, void vc4_crtc_get_margins(struct drm_crtc_state *state,
......
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