Commit 00f24897 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm: drop msm_kms_funcs::get_format() callback

Now as all subdrivers were converted to use common database of formats,
drop the get_format() callback and use mdp_get_format() directly.
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/590431/
Link: https://lore.kernel.org/r/20240420-dpu-format-v2-9-9e93226cbffd@linaro.org
parent b228501f
...@@ -274,7 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine( ...@@ -274,7 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
drm_mode_to_intf_timing_params(phys_enc, &mode, &timing_params); drm_mode_to_intf_timing_params(phys_enc, &mode, &timing_params);
fmt = phys_enc->dpu_kms->base.funcs->get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0); fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
DPU_DEBUG_VIDENC(phys_enc, "fmt_fourcc 0x%X\n", fmt_fourcc); DPU_DEBUG_VIDENC(phys_enc, "fmt_fourcc 0x%X\n", fmt_fourcc);
if (phys_enc->hw_cdm) if (phys_enc->hw_cdm)
...@@ -414,7 +414,7 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc) ...@@ -414,7 +414,7 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
ctl = phys_enc->hw_ctl; ctl = phys_enc->hw_ctl;
fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc); fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc);
fmt = phys_enc->dpu_kms->base.funcs->get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0); fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
DPU_DEBUG_VIDENC(phys_enc, "\n"); DPU_DEBUG_VIDENC(phys_enc, "\n");
......
...@@ -326,8 +326,7 @@ static void dpu_encoder_phys_wb_setup( ...@@ -326,8 +326,7 @@ static void dpu_encoder_phys_wb_setup(
wb_job = wb_enc->wb_job; wb_job = wb_enc->wb_job;
format = msm_framebuffer_format(wb_enc->wb_job->fb); format = msm_framebuffer_format(wb_enc->wb_job->fb);
dpu_fmt = phys_enc->dpu_kms->base.funcs->get_format(&phys_enc->dpu_kms->base, dpu_fmt = mdp_get_format(&phys_enc->dpu_kms->base, format->pixel_format, wb_job->fb->modifier);
format->pixel_format, wb_job->fb->modifier);
DPU_DEBUG("[mode_set:%d, \"%s\",%d,%d]\n", DPU_DEBUG("[mode_set:%d, \"%s\",%d,%d]\n",
hw_wb->idx - WB_0, mode.name, hw_wb->idx - WB_0, mode.name,
...@@ -577,7 +576,7 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc ...@@ -577,7 +576,7 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc
format = msm_framebuffer_format(job->fb); format = msm_framebuffer_format(job->fb);
wb_cfg->dest.format = phys_enc->dpu_kms->base.funcs->get_format(&phys_enc->dpu_kms->base, wb_cfg->dest.format = mdp_get_format(&phys_enc->dpu_kms->base,
format->pixel_format, job->fb->modifier); format->pixel_format, job->fb->modifier);
if (!wb_cfg->dest.format) { if (!wb_cfg->dest.format) {
/* this error should be detected during atomic_check */ /* this error should be detected during atomic_check */
......
...@@ -982,7 +982,6 @@ static const struct msm_kms_funcs kms_funcs = { ...@@ -982,7 +982,6 @@ static const struct msm_kms_funcs kms_funcs = {
.enable_vblank = dpu_kms_enable_vblank, .enable_vblank = dpu_kms_enable_vblank,
.disable_vblank = dpu_kms_disable_vblank, .disable_vblank = dpu_kms_disable_vblank,
.check_modified_format = dpu_format_check_modified_format, .check_modified_format = dpu_format_check_modified_format,
.get_format = mdp_get_format,
.destroy = dpu_kms_destroy, .destroy = dpu_kms_destroy,
.snapshot = dpu_kms_mdp_snapshot, .snapshot = dpu_kms_mdp_snapshot,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
...@@ -627,7 +627,7 @@ static void _dpu_plane_color_fill(struct dpu_plane *pdpu, ...@@ -627,7 +627,7 @@ static void _dpu_plane_color_fill(struct dpu_plane *pdpu,
* select fill format to match user property expectation, * select fill format to match user property expectation,
* h/w only supports RGB variants * h/w only supports RGB variants
*/ */
fmt = priv->kms->funcs->get_format(priv->kms, DRM_FORMAT_ABGR8888, 0); fmt = mdp_get_format(priv->kms, DRM_FORMAT_ABGR8888, 0);
/* should not happen ever */ /* should not happen ever */
if (!fmt) if (!fmt)
return; return;
......
...@@ -151,7 +151,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -151,7 +151,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.flush_commit = mdp4_flush_commit, .flush_commit = mdp4_flush_commit,
.wait_flush = mdp4_wait_flush, .wait_flush = mdp4_wait_flush,
.complete_commit = mdp4_complete_commit, .complete_commit = mdp4_complete_commit,
.get_format = mdp_get_format,
.round_pixclk = mdp4_round_pixclk, .round_pixclk = mdp4_round_pixclk,
.destroy = mdp4_destroy, .destroy = mdp4_destroy,
}, },
......
...@@ -224,7 +224,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -224,7 +224,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.prepare_commit = mdp5_prepare_commit, .prepare_commit = mdp5_prepare_commit,
.wait_flush = mdp5_wait_flush, .wait_flush = mdp5_wait_flush,
.complete_commit = mdp5_complete_commit, .complete_commit = mdp5_complete_commit,
.get_format = mdp_get_format,
.destroy = mdp5_kms_destroy, .destroy = mdp5_kms_destroy,
}, },
.set_irqmask = mdp5_set_irqmask, .set_irqmask = mdp5_set_irqmask,
......
...@@ -181,7 +181,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, ...@@ -181,7 +181,7 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
&mode_cmd->pixel_format); &mode_cmd->pixel_format);
n = info->num_planes; n = info->num_planes;
format = kms->funcs->get_format(kms, mode_cmd->pixel_format, format = mdp_get_format(kms, mode_cmd->pixel_format,
mode_cmd->modifier[0]); mode_cmd->modifier[0]);
if (!format) { if (!format) {
DRM_DEV_ERROR(dev->dev, "unsupported pixel format: %p4cc\n", DRM_DEV_ERROR(dev->dev, "unsupported pixel format: %p4cc\n",
......
...@@ -92,10 +92,6 @@ struct msm_kms_funcs { ...@@ -92,10 +92,6 @@ struct msm_kms_funcs {
* Format handling: * Format handling:
*/ */
/* get msm_format w/ optional format modifiers from drm_mode_fb_cmd2 */
const struct msm_format *(*get_format)(struct msm_kms *kms,
const uint32_t format,
const uint64_t modifiers);
/* do format checking on format modified through fb_cmd2 modifiers */ /* do format checking on format modified through fb_cmd2 modifiers */
int (*check_modified_format)(const struct msm_kms *kms, int (*check_modified_format)(const struct msm_kms *kms,
const struct msm_format *msm_fmt, const struct msm_format *msm_fmt,
......
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