@@ -133,6 +133,16 @@ static const uint32_t vp_formats[] = {
DRM_FORMAT_NV12,
};
+static inline bool is_vp_format(const struct mixer_context *ctx, unsigned int win)
+{
+ switch (ctx->planes[win].pixel_format) {
+ case DRM_FORMAT_NV12:
+ return true;
+ default:
+ return false;
+ }
+}
+
static inline u32 vp_reg_read(struct mixer_resources *res, u32 reg_id)
{
return readl(res->vp_regs + reg_id);
@@ -970,7 +980,7 @@ static void mixer_win_commit(struct exynos_drm_crtc *crtc, unsigned int win)
}
mutex_unlock(&mixer_ctx->mixer_mutex);
- if (win > 1 && mixer_ctx->vp_enabled)
+ if (is_vp_format(mixer_ctx, win))
vp_video_buffer(mixer_ctx, win);
else
mixer_graph_buffer(mixer_ctx, win);
The mixer itself can't handle 'video' formats like NV12 or NV21. It needs the VP (video processor) for this task. With the previous patch we ensure that DRM planes with a NV12 format can only be created when this setup is supported. Hence the check now reduces to checking the pixel format (currently only NV12). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> --- drivers/gpu/drm/exynos/exynos_mixer.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)