Commit b6529e33 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dpu: drop enum msm_display_caps

After the commit c46f0d69 ("drm/msm: remove unused hotplug and edid
macros from msm_drv.h") the msm_display_caps enum contains two bits
describing whether the encoder should work in video or command mode.
Drop the enum and replace capabilities field in struct msm_display_info
with boolean is_cmd_mode field.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/485454/
Link: https://lore.kernel.org/r/20220507115942.1705872-2-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent b1ed585a
...@@ -634,7 +634,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc, ...@@ -634,7 +634,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc,
} }
if (hw_mdptop->ops.setup_vsync_source && if (hw_mdptop->ops.setup_vsync_source &&
disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) { disp_info->is_cmd_mode) {
for (i = 0; i < dpu_enc->num_phys_encs; i++) for (i = 0; i < dpu_enc->num_phys_encs; i++)
vsync_cfg.ppnumber[i] = dpu_enc->hw_pp[i]->idx; vsync_cfg.ppnumber[i] = dpu_enc->hw_pp[i]->idx;
...@@ -718,8 +718,7 @@ static int dpu_encoder_resource_control(struct drm_encoder *drm_enc, ...@@ -718,8 +718,7 @@ static int dpu_encoder_resource_control(struct drm_encoder *drm_enc,
} }
dpu_enc = to_dpu_encoder_virt(drm_enc); dpu_enc = to_dpu_encoder_virt(drm_enc);
priv = drm_enc->dev->dev_private; priv = drm_enc->dev->dev_private;
is_vid_mode = dpu_enc->disp_info.capabilities & is_vid_mode = !dpu_enc->disp_info.is_cmd_mode;
MSM_DISPLAY_CAP_VID_MODE;
/* /*
* when idle_pc is not supported, process only KICKOFF, STOP and MODESET * when idle_pc is not supported, process only KICKOFF, STOP and MODESET
...@@ -1603,7 +1602,7 @@ void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc) ...@@ -1603,7 +1602,7 @@ void dpu_encoder_trigger_kickoff_pending(struct drm_encoder *drm_enc)
/* update only for command mode primary ctl */ /* update only for command mode primary ctl */
if ((phys == dpu_enc->cur_master) && if ((phys == dpu_enc->cur_master) &&
(disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) disp_info->is_cmd_mode
&& ctl->ops.trigger_pending) && ctl->ops.trigger_pending)
ctl->ops.trigger_pending(ctl); ctl->ops.trigger_pending(ctl);
} }
...@@ -2139,20 +2138,19 @@ static int dpu_encoder_virt_add_phys_encs( ...@@ -2139,20 +2138,19 @@ static int dpu_encoder_virt_add_phys_encs(
return -EINVAL; return -EINVAL;
} }
if (disp_info->capabilities & MSM_DISPLAY_CAP_VID_MODE) {
enc = dpu_encoder_phys_vid_init(params); if (disp_info->intf_type == DRM_MODE_ENCODER_VIRTUAL) {
enc = dpu_encoder_phys_wb_init(params);
if (IS_ERR(enc)) { if (IS_ERR(enc)) {
DPU_ERROR_ENC(dpu_enc, "failed to init vid enc: %ld\n", DPU_ERROR_ENC(dpu_enc, "failed to init wb enc: %ld\n",
PTR_ERR(enc)); PTR_ERR(enc));
return PTR_ERR(enc); return PTR_ERR(enc);
} }
dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc; dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
++dpu_enc->num_phys_encs; ++dpu_enc->num_phys_encs;
} } else if (disp_info->is_cmd_mode) {
if (disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) {
enc = dpu_encoder_phys_cmd_init(params); enc = dpu_encoder_phys_cmd_init(params);
if (IS_ERR(enc)) { if (IS_ERR(enc)) {
...@@ -2163,14 +2161,12 @@ static int dpu_encoder_virt_add_phys_encs( ...@@ -2163,14 +2161,12 @@ static int dpu_encoder_virt_add_phys_encs(
dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc; dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
++dpu_enc->num_phys_encs; ++dpu_enc->num_phys_encs;
} } else {
enc = dpu_encoder_phys_vid_init(params);
if (disp_info->intf_type == DRM_MODE_ENCODER_VIRTUAL) {
enc = dpu_encoder_phys_wb_init(params);
if (IS_ERR(enc)) { if (IS_ERR(enc)) {
DPU_ERROR_ENC(dpu_enc, "failed to init wb enc: %ld\n", DPU_ERROR_ENC(dpu_enc, "failed to init vid enc: %ld\n",
PTR_ERR(enc)); PTR_ERR(enc));
return PTR_ERR(enc); return PTR_ERR(enc);
} }
...@@ -2230,8 +2226,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, ...@@ -2230,8 +2226,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
DPU_DEBUG("dsi_info->num_of_h_tiles %d\n", disp_info->num_of_h_tiles); DPU_DEBUG("dsi_info->num_of_h_tiles %d\n", disp_info->num_of_h_tiles);
if ((disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) || if (disp_info->intf_type != DRM_MODE_ENCODER_VIRTUAL)
(disp_info->capabilities & MSM_DISPLAY_CAP_VID_MODE))
dpu_enc->idle_pc_supported = dpu_enc->idle_pc_supported =
dpu_kms->catalog->caps->has_idle_pc; dpu_kms->catalog->caps->has_idle_pc;
......
...@@ -21,19 +21,19 @@ ...@@ -21,19 +21,19 @@
/** /**
* struct msm_display_info - defines display properties * struct msm_display_info - defines display properties
* @intf_type: DRM_MODE_ENCODER_ type * @intf_type: DRM_MODE_ENCODER_ type
* @capabilities: Bitmask of display flags
* @num_of_h_tiles: Number of horizontal tiles in case of split interface * @num_of_h_tiles: Number of horizontal tiles in case of split interface
* @h_tile_instance: Controller instance used per tile. Number of elements is * @h_tile_instance: Controller instance used per tile. Number of elements is
* based on num_of_h_tiles * based on num_of_h_tiles
* @is_cmd_mode Boolean to indicate if the CMD mode is requested
* @is_te_using_watchdog_timer: Boolean to indicate watchdog TE is * @is_te_using_watchdog_timer: Boolean to indicate watchdog TE is
* used instead of panel TE in cmd mode panels * used instead of panel TE in cmd mode panels
* @dsc: DSC configuration data for DSC-enabled displays * @dsc: DSC configuration data for DSC-enabled displays
*/ */
struct msm_display_info { struct msm_display_info {
int intf_type; int intf_type;
uint32_t capabilities;
uint32_t num_of_h_tiles; uint32_t num_of_h_tiles;
uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY];
bool is_cmd_mode;
bool is_te_using_watchdog_timer; bool is_te_using_watchdog_timer;
struct msm_display_dsc_config *dsc; struct msm_display_dsc_config *dsc;
}; };
......
...@@ -582,9 +582,7 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev, ...@@ -582,9 +582,7 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev,
} }
info.h_tile_instance[info.num_of_h_tiles++] = i; info.h_tile_instance[info.num_of_h_tiles++] = i;
info.capabilities = msm_dsi_is_cmd_mode(priv->dsi[i]) ? info.is_cmd_mode = msm_dsi_is_cmd_mode(priv->dsi[i]);
MSM_DISPLAY_CAP_CMD_MODE :
MSM_DISPLAY_CAP_VID_MODE;
info.dsc = msm_dsi_get_dsc_config(priv->dsi[i]); info.dsc = msm_dsi_get_dsc_config(priv->dsi[i]);
...@@ -637,7 +635,6 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, ...@@ -637,7 +635,6 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev,
info.num_of_h_tiles = 1; info.num_of_h_tiles = 1;
info.h_tile_instance[0] = i; info.h_tile_instance[0] = i;
info.capabilities = MSM_DISPLAY_CAP_VID_MODE;
info.intf_type = encoder->encoder_type; info.intf_type = encoder->encoder_type;
rc = dpu_encoder_setup(dev, encoder, &info); rc = dpu_encoder_setup(dev, encoder, &info);
if (rc) { if (rc) {
......
...@@ -61,16 +61,6 @@ enum msm_dp_controller { ...@@ -61,16 +61,6 @@ enum msm_dp_controller {
#define MSM_GPU_MAX_RINGS 4 #define MSM_GPU_MAX_RINGS 4
#define MAX_H_TILES_PER_DISPLAY 2 #define MAX_H_TILES_PER_DISPLAY 2
/**
* enum msm_display_caps - features/capabilities supported by displays
* @MSM_DISPLAY_CAP_VID_MODE: Video or "active" mode supported
* @MSM_DISPLAY_CAP_CMD_MODE: Command mode supported
*/
enum msm_display_caps {
MSM_DISPLAY_CAP_VID_MODE = BIT(0),
MSM_DISPLAY_CAP_CMD_MODE = BIT(1),
};
/** /**
* enum msm_event_wait - type of HW events to wait for * enum msm_event_wait - type of HW events to wait for
* @MSM_ENC_COMMIT_DONE - wait for the driver to flush the registers to HW * @MSM_ENC_COMMIT_DONE - wait for the driver to flush the registers to HW
......
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