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:
Samantha Tran
2019-04-24 14:15:23 -07:00
والد ab3c7fdd80
کامیت 3be27eafcc
31فایلهای تغییر یافته به همراه680 افزوده شده و 67 حذف شده

مشاهده پرونده

@@ -16,6 +16,7 @@
#include "sde_encoder.h"
#include "sde_connector.h"
#include "sde_hw_dsc.h"
#include "sde_crtc.h"
#define RESERVED_BY_OTHER(h, r) \
(((h)->rsvp && ((h)->rsvp->enc_id != (r)->enc_id)) ||\
@@ -879,8 +880,8 @@ static int _sde_rm_reserve_lms(
int i, rc = 0;
if (!reqs->topology->num_lm) {
SDE_ERROR("invalid number of lm: %d\n", reqs->topology->num_lm);
return -EINVAL;
SDE_DEBUG("invalid number of lm: %d\n", reqs->topology->num_lm);
return 0;
}
/* Find a primary mixer */
@@ -994,6 +995,11 @@ static int _sde_rm_reserve_ctls(
struct sde_rm_hw_iter iter;
int i = 0;
if (!top->num_ctl) {
SDE_DEBUG("invalid number of ctl: %d\n", top->num_ctl);
return 0;
}
memset(&ctls, 0, sizeof(ctls));
sde_rm_init_hw_iter(&iter, 0, SDE_HW_BLK_CTL);
@@ -1551,9 +1557,23 @@ static int _sde_rm_populate_requirements(
* Set the requirement for LM which has CWB support if CWB is
* found enabled.
*/
if (!RM_RQ_CWB(reqs) && sde_encoder_in_clone_mode(enc))
if (!RM_RQ_CWB(reqs) && sde_encoder_in_clone_mode(enc)) {
reqs->top_ctrl |= BIT(SDE_RM_TOPCTL_CWB);
/*
* topology selection based on conn mode is not valid for CWB
* as WB conn populates modes based on max_mixer_width check
* but primary can be using dual LMs. This topology override for
* CWB is to check number of datapath active in primary and
* allocate same number of LM/PP blocks reserved for CWB
*/
reqs->topology =
&rm->topology_tbl[SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE];
if (sde_crtc_get_num_datapath(crtc_state->crtc) == 1)
reqs->topology =
&rm->topology_tbl[SDE_RM_TOPOLOGY_SINGLEPIPE];
}
SDE_DEBUG("top_ctrl: 0x%llX num_h_tiles: %d\n", reqs->top_ctrl,
reqs->hw_res.display_num_of_h_tiles);
SDE_DEBUG("num_lm: %d num_ctl: %d topology: %d split_display: %d\n",
@@ -1904,3 +1924,100 @@ end:
return ret;
}
int sde_rm_ext_blk_create_reserve(struct sde_rm *rm,
struct sde_hw_blk *hw, struct drm_encoder *enc)
{
struct sde_rm_hw_blk *blk;
struct sde_rm_rsvp *rsvp;
int ret = 0;
if (!rm || !hw || !enc) {
SDE_ERROR("invalid parameters\n");
return -EINVAL;
}
if (hw->type >= SDE_HW_BLK_MAX) {
SDE_ERROR("invalid HW type\n");
return -EINVAL;
}
mutex_lock(&rm->rm_lock);
rsvp = _sde_rm_get_rsvp(rm, enc);
if (!rsvp) {
rsvp = kzalloc(sizeof(*rsvp), GFP_KERNEL);
if (!rsvp) {
ret = -ENOMEM;
goto end;
}
rsvp->seq = ++rm->rsvp_next_seq;
rsvp->enc_id = enc->base.id;
list_add_tail(&rsvp->list, &rm->rsvps);
SDE_DEBUG("create rsvp %d for enc %d\n",
rsvp->seq, rsvp->enc_id);
}
blk = kzalloc(sizeof(*blk), GFP_KERNEL);
if (!blk) {
ret = -ENOMEM;
goto end;
}
blk->type = hw->type;
blk->id = hw->id;
blk->hw = hw;
blk->rsvp = rsvp;
list_add_tail(&blk->list, &rm->hw_blks[hw->type]);
SDE_DEBUG("create blk %d %d for rsvp %d enc %d\n", blk->type, blk->id,
rsvp->seq, rsvp->enc_id);
end:
mutex_unlock(&rm->rm_lock);
return ret;
}
int sde_rm_ext_blk_destroy(struct sde_rm *rm,
struct drm_encoder *enc)
{
struct sde_rm_hw_blk *blk = NULL, *p;
struct sde_rm_rsvp *rsvp;
enum sde_hw_blk_type type;
int ret = 0;
if (!rm || !enc) {
SDE_ERROR("invalid parameters\n");
return -EINVAL;
}
mutex_lock(&rm->rm_lock);
rsvp = _sde_rm_get_rsvp(rm, enc);
if (!rsvp) {
ret = -ENOENT;
SDE_ERROR("failed to find rsvp for enc %d\n", enc->base.id);
goto end;
}
for (type = 0; type < SDE_HW_BLK_MAX; type++) {
list_for_each_entry_safe(blk, p, &rm->hw_blks[type], list) {
if (blk->rsvp == rsvp) {
list_del(&blk->list);
SDE_DEBUG("del blk %d %d from rsvp %d enc %d\n",
blk->type, blk->id,
rsvp->seq, rsvp->enc_id);
kfree(blk);
}
}
}
SDE_DEBUG("del rsvp %d\n", rsvp->seq);
list_del(&rsvp->list);
kfree(rsvp);
end:
mutex_unlock(&rm->rm_lock);
return ret;
}