Commit a72b0458 authored by Maxime Ripard's avatar Maxime Ripard

drm/vc4: kms: Split the HVS muxing check in a separate function

The code that assigns HVS channels during atomic_check is starting to grow
a bit big, let's move it into a separate function.
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Tested-by: default avatarHoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: default avatarHoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20201105135656.383350-5-maxime@cerno.tech
parent a9661f27
...@@ -662,13 +662,13 @@ static int vc4_load_tracker_obj_init(struct vc4_dev *vc4) ...@@ -662,13 +662,13 @@ static int vc4_load_tracker_obj_init(struct vc4_dev *vc4)
return drmm_add_action_or_reset(&vc4->base, vc4_load_tracker_obj_fini, NULL); return drmm_add_action_or_reset(&vc4->base, vc4_load_tracker_obj_fini, NULL);
} }
static int static int vc4_pv_muxing_atomic_check(struct drm_device *dev,
vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) struct drm_atomic_state *state)
{ {
unsigned long unassigned_channels = GENMASK(HVS_NUM_CHANNELS - 1, 0); unsigned long unassigned_channels = GENMASK(HVS_NUM_CHANNELS - 1, 0);
struct drm_crtc_state *old_crtc_state, *new_crtc_state; struct drm_crtc_state *old_crtc_state, *new_crtc_state;
struct drm_crtc *crtc; struct drm_crtc *crtc;
int i, ret; unsigned int i;
/* /*
* Since the HVS FIFOs are shared across all the pixelvalves and * Since the HVS FIFOs are shared across all the pixelvalves and
...@@ -741,6 +741,18 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) ...@@ -741,6 +741,18 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)
} }
} }
return 0;
}
static int
vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)
{
int ret;
ret = vc4_pv_muxing_atomic_check(dev, state);
if (ret)
return ret;
ret = vc4_ctm_atomic_check(dev, state); ret = vc4_ctm_atomic_check(dev, state);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
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