disp: msm: snapshot of msm and sde driver
This snapshot ports changes from 4.14 to 4.19 into the msm and sde layer. Snapshot was taken as of commit 0f8fb25421ff ("cnss2: Add device version to SOC info structure"). Change-Id: I59b799a78319c2db6930a2a10bc38976f8c09898 Signed-off-by: Samantha Tran <samtran@codeaurora.org>
This commit is contained in:
@@ -166,6 +166,7 @@ enum sde_enc_rc_states {
|
||||
* @enc_spin_lock: Virtual-Encoder-Wide Spin Lock for IRQ purposes
|
||||
* @bus_scaling_client: Client handle to the bus scaling interface
|
||||
* @te_source: vsync source pin information
|
||||
* @ops: Encoder ops from init function
|
||||
* @num_phys_encs: Actual number of physical encoders contained.
|
||||
* @phys_encs: Container of physical encoders managed.
|
||||
* @phys_vid_encs: Video physical encoders for panel mode switch.
|
||||
@@ -234,6 +235,8 @@ struct sde_encoder_virt {
|
||||
uint32_t display_num_of_h_tiles;
|
||||
uint32_t te_source;
|
||||
|
||||
struct sde_encoder_ops ops;
|
||||
|
||||
unsigned int num_phys_encs;
|
||||
struct sde_encoder_phys *phys_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
|
||||
struct sde_encoder_phys *phys_vid_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
|
||||
@@ -2849,7 +2852,7 @@ static void sde_encoder_virt_mode_set(struct drm_encoder *drm_enc,
|
||||
struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
|
||||
|
||||
if (phys) {
|
||||
if (!sde_enc->hw_pp[i]) {
|
||||
if (!sde_enc->hw_pp[i] && sde_enc->topology.num_intf) {
|
||||
SDE_ERROR_ENC(sde_enc,
|
||||
"invalid pingpong block for the encoder\n");
|
||||
return;
|
||||
@@ -3315,8 +3318,7 @@ void sde_encoder_helper_phys_disable(struct sde_encoder_phys *phys_enc,
|
||||
struct sde_encoder_virt *sde_enc;
|
||||
|
||||
if (wb_enc) {
|
||||
if (sde_encoder_helper_reset_mixers(phys_enc,
|
||||
wb_enc->fb_disable))
|
||||
if (sde_encoder_helper_reset_mixers(phys_enc, NULL))
|
||||
return;
|
||||
|
||||
if (wb_enc->hw_wb->ops.bind_pingpong_blk) {
|
||||
@@ -3657,6 +3659,24 @@ int sde_encoder_idle_request(struct drm_encoder *drm_enc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sde_encoder_get_ctlstart_timeout_state(struct drm_encoder *drm_enc)
|
||||
{
|
||||
struct sde_encoder_virt *sde_enc = NULL;
|
||||
int i, count = 0;
|
||||
|
||||
if (!drm_enc)
|
||||
return 0;
|
||||
|
||||
sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
|
||||
for (i = 0; i < sde_enc->num_phys_encs; i++) {
|
||||
count += atomic_read(&sde_enc->phys_encs[i]->ctlstart_timeout);
|
||||
atomic_set(&sde_enc->phys_encs[i]->ctlstart_timeout, 0);
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* _sde_encoder_trigger_flush - trigger flush for a physical encoder
|
||||
* drm_enc: Pointer to drm encoder structure
|
||||
@@ -5357,6 +5377,23 @@ static int sde_encoder_setup_display(struct sde_encoder_virt *sde_enc,
|
||||
SDE_DEBUG("h_tile_instance %d = %d, split_role %d\n",
|
||||
i, controller_id, phys_params.split_role);
|
||||
|
||||
if (sde_enc->ops.phys_init) {
|
||||
struct sde_encoder_phys *enc;
|
||||
|
||||
enc = sde_enc->ops.phys_init(intf_type,
|
||||
controller_id,
|
||||
&phys_params);
|
||||
if (enc) {
|
||||
sde_enc->phys_encs[sde_enc->num_phys_encs] =
|
||||
enc;
|
||||
++sde_enc->num_phys_encs;
|
||||
} else
|
||||
SDE_ERROR_ENC(sde_enc,
|
||||
"failed to add phys encs\n");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (intf_type == INTF_WB) {
|
||||
phys_params.intf_idx = INTF_MAX;
|
||||
phys_params.wb_idx = sde_encoder_get_wb(
|
||||
@@ -5429,9 +5466,10 @@ static const struct drm_encoder_funcs sde_encoder_funcs = {
|
||||
.early_unregister = sde_encoder_early_unregister,
|
||||
};
|
||||
|
||||
struct drm_encoder *sde_encoder_init(
|
||||
struct drm_encoder *sde_encoder_init_with_ops(
|
||||
struct drm_device *dev,
|
||||
struct msm_display_info *disp_info)
|
||||
struct msm_display_info *disp_info,
|
||||
const struct sde_encoder_ops *ops)
|
||||
{
|
||||
struct msm_drm_private *priv = dev->dev_private;
|
||||
struct sde_kms *sde_kms = to_sde_kms(priv->kms);
|
||||
@@ -5448,6 +5486,9 @@ struct drm_encoder *sde_encoder_init(
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ops)
|
||||
sde_enc->ops = *ops;
|
||||
|
||||
mutex_init(&sde_enc->enc_lock);
|
||||
ret = sde_encoder_setup_display(sde_enc, sde_kms, disp_info,
|
||||
&drm_enc_mode);
|
||||
@@ -5519,6 +5560,13 @@ fail:
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
struct drm_encoder *sde_encoder_init(
|
||||
struct drm_device *dev,
|
||||
struct msm_display_info *disp_info)
|
||||
{
|
||||
return sde_encoder_init_with_ops(dev, disp_info, NULL);
|
||||
}
|
||||
|
||||
int sde_encoder_wait_for_event(struct drm_encoder *drm_enc,
|
||||
enum msm_event_wait event)
|
||||
{
|
||||
|
Viittaa uudesa ongelmassa
Block a user