Disp: Snapshot change for lahaina display driver
This snapshot change adds downstream support for drm 5.x+(msm_lahaina branch) linux kernel. Change-Id: Ia691c95da155a00e449c91a2f1a5b20a8e71aed4 Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "dsi_display.h"
|
||||
#include "sde_crtc.h"
|
||||
#include "sde_rm.h"
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#define BL_NODE_NAME_SIZE 32
|
||||
#define HDR10_PLUS_VSIF_TYPE_CODE 0x81
|
||||
@@ -2105,23 +2106,26 @@ sde_connector_atomic_best_encoder(struct drm_connector *connector,
|
||||
}
|
||||
|
||||
static int sde_connector_atomic_check(struct drm_connector *connector,
|
||||
struct drm_connector_state *new_conn_state)
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct sde_connector *c_conn;
|
||||
struct sde_connector_state *c_state;
|
||||
bool qsync_dirty = false, has_modeset = false;
|
||||
struct drm_connector_state *new_conn_state;
|
||||
|
||||
if (!connector) {
|
||||
SDE_ERROR("invalid connector\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
c_conn = to_sde_connector(connector);
|
||||
new_conn_state = drm_atomic_get_new_connector_state(state, connector);
|
||||
|
||||
if (!new_conn_state) {
|
||||
SDE_ERROR("invalid connector state\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
c_conn = to_sde_connector(connector);
|
||||
c_state = to_sde_connector_state(new_conn_state);
|
||||
|
||||
has_modeset = sde_crtc_atomic_check_has_modeset(new_conn_state->state,
|
||||
@@ -2135,10 +2139,11 @@ static int sde_connector_atomic_check(struct drm_connector *connector,
|
||||
SDE_ERROR("invalid qsync update during modeset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
new_conn_state = drm_atomic_get_new_connector_state(state, connector);
|
||||
|
||||
if (c_conn->ops.atomic_check)
|
||||
return c_conn->ops.atomic_check(connector,
|
||||
c_conn->display, new_conn_state);
|
||||
c_conn->display, state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -295,7 +295,7 @@ struct sde_connector_ops {
|
||||
*/
|
||||
int (*atomic_check)(struct drm_connector *connector,
|
||||
void *display,
|
||||
struct drm_connector_state *c_state);
|
||||
struct drm_atomic_state *state);
|
||||
|
||||
/**
|
||||
* pre_destroy - handle pre destroy operations for the connector
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include <uapi/drm/sde_drm.h>
|
||||
#include <drm/drm_mode.h>
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_flip_work.h>
|
||||
#include <linux/clk/qcom.h>
|
||||
|
||||
@@ -2794,8 +2794,8 @@ static int _sde_crtc_check_dest_scaler_data(struct drm_crtc *crtc,
|
||||
struct sde_crtc_state *cstate;
|
||||
struct drm_display_mode *mode;
|
||||
struct sde_kms *kms;
|
||||
struct sde_hw_ds *hw_ds;
|
||||
struct sde_hw_ds_cfg *cfg;
|
||||
struct sde_hw_ds *hw_ds = NULL;
|
||||
struct sde_hw_ds_cfg *cfg = NULL;
|
||||
u32 ret = 0;
|
||||
u32 num_ds_enable = 0, hdisplay = 0;
|
||||
u32 max_in_width = 0, max_out_width = 0;
|
||||
@@ -4538,7 +4538,7 @@ static int _sde_crtc_atomic_check_pstates(struct drm_crtc *crtc,
|
||||
struct sde_crtc *sde_crtc;
|
||||
struct sde_crtc_state *cstate;
|
||||
struct sde_kms *kms;
|
||||
struct drm_plane *plane;
|
||||
struct drm_plane *plane = NULL;
|
||||
struct drm_display_mode *mode;
|
||||
int rc = 0, cnt = 0;
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include "msm_drv.h"
|
||||
#include "sde_kms.h"
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include "sde_hwio.h"
|
||||
#include "sde_hw_catalog.h"
|
||||
#include "sde_hw_intf.h"
|
||||
@@ -226,7 +226,6 @@ enum sde_enc_rc_states {
|
||||
* @recovery_events_enabled: status of hw recovery feature enable by client
|
||||
* @elevated_ahb_vote: increase AHB bus speed for the first frame
|
||||
* after power collapse
|
||||
* @pm_qos_cpu_req: pm_qos request for cpu frequency
|
||||
* @mode_info: stores the current mode and should be used
|
||||
* only in commit phase
|
||||
*/
|
||||
@@ -292,7 +291,6 @@ struct sde_encoder_virt {
|
||||
|
||||
bool recovery_events_enabled;
|
||||
bool elevated_ahb_vote;
|
||||
struct pm_qos_request pm_qos_cpu_req;
|
||||
struct msm_mode_info mode_info;
|
||||
};
|
||||
|
||||
@@ -314,44 +312,6 @@ void sde_encoder_uidle_enable(struct drm_encoder *drm_enc, bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
static void _sde_encoder_pm_qos_add_request(struct drm_encoder *drm_enc,
|
||||
struct sde_kms *sde_kms)
|
||||
{
|
||||
struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
struct pm_qos_request *req;
|
||||
u32 cpu_mask;
|
||||
u32 cpu_dma_latency;
|
||||
int cpu;
|
||||
|
||||
if (!sde_kms->catalog || !sde_kms->catalog->perf.cpu_mask)
|
||||
return;
|
||||
|
||||
cpu_mask = sde_kms->catalog->perf.cpu_mask;
|
||||
cpu_dma_latency = sde_kms->catalog->perf.cpu_dma_latency;
|
||||
|
||||
req = &sde_enc->pm_qos_cpu_req;
|
||||
req->type = PM_QOS_REQ_AFFINE_CORES;
|
||||
cpumask_empty(&req->cpus_affine);
|
||||
for_each_possible_cpu(cpu) {
|
||||
if ((1 << cpu) & cpu_mask)
|
||||
cpumask_set_cpu(cpu, &req->cpus_affine);
|
||||
}
|
||||
pm_qos_add_request(req, PM_QOS_CPU_DMA_LATENCY, cpu_dma_latency);
|
||||
|
||||
SDE_EVT32_VERBOSE(DRMID(drm_enc), cpu_mask, cpu_dma_latency);
|
||||
}
|
||||
|
||||
static void _sde_encoder_pm_qos_remove_request(struct drm_encoder *drm_enc,
|
||||
struct sde_kms *sde_kms)
|
||||
{
|
||||
struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(drm_enc);
|
||||
|
||||
if (!sde_kms->catalog || !sde_kms->catalog->perf.cpu_mask)
|
||||
return;
|
||||
|
||||
pm_qos_remove_request(&sde_enc->pm_qos_cpu_req);
|
||||
}
|
||||
|
||||
static bool _sde_encoder_is_autorefresh_enabled(
|
||||
struct sde_encoder_virt *sde_enc)
|
||||
{
|
||||
@@ -2165,12 +2125,7 @@ static int _sde_encoder_resource_control_helper(struct drm_encoder *drm_enc,
|
||||
/* enable all the irq */
|
||||
_sde_encoder_irq_control(drm_enc, true);
|
||||
|
||||
if (is_cmd_mode)
|
||||
_sde_encoder_pm_qos_add_request(drm_enc, sde_kms);
|
||||
|
||||
} else {
|
||||
if (is_cmd_mode)
|
||||
_sde_encoder_pm_qos_remove_request(drm_enc, sde_kms);
|
||||
|
||||
/* disable all the irq */
|
||||
_sde_encoder_irq_control(drm_enc, false);
|
||||
|
@@ -703,8 +703,8 @@ static int sde_encoder_phys_wb_atomic_check(
|
||||
const struct drm_display_mode *mode = &crtc_state->mode;
|
||||
int rc;
|
||||
|
||||
SDE_DEBUG("[atomic_check:%d,%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode->base.id, mode->name,
|
||||
SDE_DEBUG("[atomic_check:%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode->name,
|
||||
mode->hdisplay, mode->vdisplay);
|
||||
|
||||
if (!conn_state || !conn_state->connector) {
|
||||
@@ -962,8 +962,8 @@ static void sde_encoder_phys_wb_setup(
|
||||
struct drm_framebuffer *fb;
|
||||
struct sde_rect *wb_roi = &wb_enc->wb_roi;
|
||||
|
||||
SDE_DEBUG("[mode_set:%d,%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode.base.id, mode.name,
|
||||
SDE_DEBUG("[mode_set:%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode.name,
|
||||
mode.hdisplay, mode.vdisplay);
|
||||
|
||||
memset(wb_roi, 0, sizeof(struct sde_rect));
|
||||
@@ -1150,9 +1150,9 @@ static void sde_encoder_phys_wb_mode_set(
|
||||
phys_enc->cached_mode = *adj_mode;
|
||||
instance = phys_enc->split_role == ENC_ROLE_SLAVE ? 1 : 0;
|
||||
|
||||
SDE_DEBUG("[mode_set_cache:%d,%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode->base.id,
|
||||
mode->name, mode->hdisplay, mode->vdisplay);
|
||||
SDE_DEBUG("[mode_set_cache:%d,\"%s\",%d,%d]\n",
|
||||
hw_wb->idx - WB_0, mode->name,
|
||||
mode->hdisplay, mode->vdisplay);
|
||||
|
||||
phys_enc->hw_ctl = NULL;
|
||||
phys_enc->hw_cdm = NULL;
|
||||
@@ -1401,6 +1401,7 @@ static int _sde_encoder_phys_wb_init_internal_fb(
|
||||
uint32_t size;
|
||||
int nplanes, i, ret;
|
||||
struct msm_gem_address_space *aspace;
|
||||
const struct drm_format_info *info;
|
||||
|
||||
if (!wb_enc || !wb_enc->base.parent || !wb_enc->base.sde_kms) {
|
||||
SDE_ERROR("invalid params\n");
|
||||
@@ -1434,7 +1435,8 @@ static int _sde_encoder_phys_wb_init_internal_fb(
|
||||
}
|
||||
|
||||
/* allocate gem tracking object */
|
||||
nplanes = drm_format_num_planes(pixel_format);
|
||||
info = drm_get_format_info(dev, &mode_cmd);
|
||||
nplanes = info->num_planes;
|
||||
if (nplanes >= SDE_MAX_PLANES) {
|
||||
SDE_ERROR("requested format has too many planes\n");
|
||||
return -EINVAL;
|
||||
@@ -1452,8 +1454,7 @@ static int _sde_encoder_phys_wb_init_internal_fb(
|
||||
|
||||
for (i = 0; i < nplanes; ++i) {
|
||||
wb_enc->bo_disable[i] = wb_enc->bo_disable[0];
|
||||
mode_cmd.pitches[i] = width *
|
||||
drm_format_plane_cpp(pixel_format, i);
|
||||
mode_cmd.pitches[i] = width * info->cpp[i];
|
||||
}
|
||||
|
||||
fb = msm_framebuffer_init(dev, &mode_cmd, wb_enc->bo_disable);
|
||||
|
@@ -1168,10 +1168,11 @@ int sde_format_check_modified_format(
|
||||
const struct drm_mode_fb_cmd2 *cmd,
|
||||
struct drm_gem_object **bos)
|
||||
{
|
||||
int ret, i, num_base_fmt_planes;
|
||||
const struct drm_format_info *info;
|
||||
const struct sde_format *fmt;
|
||||
struct sde_hw_fmt_layout layout;
|
||||
uint32_t bos_total_size = 0;
|
||||
int ret, i;
|
||||
|
||||
if (!msm_fmt || !cmd || !bos) {
|
||||
DRM_ERROR("invalid arguments\n");
|
||||
@@ -1179,14 +1180,16 @@ int sde_format_check_modified_format(
|
||||
}
|
||||
|
||||
fmt = to_sde_format(msm_fmt);
|
||||
num_base_fmt_planes = drm_format_num_planes(fmt->base.pixel_format);
|
||||
info = drm_format_info(fmt->base.pixel_format);
|
||||
if (!info)
|
||||
return -EINVAL;
|
||||
|
||||
ret = sde_format_get_plane_sizes(fmt, cmd->width, cmd->height,
|
||||
&layout, cmd->pitches);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < num_base_fmt_planes; i++) {
|
||||
for (i = 0; i < info->num_planes; i++) {
|
||||
if (!bos[i]) {
|
||||
DRM_ERROR("invalid handle for plane %d\n", i);
|
||||
return -EINVAL;
|
||||
|
@@ -2913,7 +2913,7 @@ static int sde_vbif_parse_dt(struct device_node *np,
|
||||
struct sde_prop_value *prop_value = NULL;
|
||||
bool prop_exists[VBIF_PROP_MAX];
|
||||
u32 off_count, vbif_len;
|
||||
struct sde_vbif_cfg *vbif;
|
||||
struct sde_vbif_cfg *vbif = NULL;
|
||||
|
||||
if (!sde_cfg) {
|
||||
SDE_ERROR("invalid argument\n");
|
||||
|
@@ -25,7 +25,8 @@
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/bootmem.h>
|
||||
#include <drm/drm_atomic_uapi.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "msm_drv.h"
|
||||
#include "msm_mmu.h"
|
||||
@@ -506,7 +507,7 @@ static int _sde_kms_secure_ctrl(struct sde_kms *sde_kms, struct drm_crtc *crtc,
|
||||
if (smmu_state->sui_misr_state == SUI_MISR_ENABLE_REQ) {
|
||||
ret = _sde_kms_sui_misr_ctrl(sde_kms, crtc, true);
|
||||
if (ret) {
|
||||
smmu_state->sui_misr_state == NONE;
|
||||
smmu_state->sui_misr_state = NONE;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -2467,9 +2468,9 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms)
|
||||
/* currently consider modes[0] as the preferred mode */
|
||||
drm_mode = list_first_entry(&connector->modes,
|
||||
struct drm_display_mode, head);
|
||||
SDE_DEBUG("drm_mode->name = %s, id=%d, type=0x%x, flags=0x%x\n",
|
||||
drm_mode->name, drm_mode->base.id,
|
||||
drm_mode->type, drm_mode->flags);
|
||||
SDE_DEBUG("drm_mode->name = %s, type=0x%x, flags=0x%x\n",
|
||||
drm_mode->name, drm_mode->type,
|
||||
drm_mode->flags);
|
||||
|
||||
/* Update CRTC drm structure */
|
||||
crtc->state->active = true;
|
||||
|
@@ -1406,6 +1406,7 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
|
||||
{
|
||||
struct sde_hw_pixel_ext *pe;
|
||||
uint32_t chroma_subsmpl_h, chroma_subsmpl_v;
|
||||
const struct drm_format_info *info = drm_format_info(fmt->base.pixel_format);
|
||||
|
||||
if (!psde || !fmt || !pstate) {
|
||||
SDE_ERROR("invalid arg(s), plane %d fmt %d state %d\n",
|
||||
@@ -1421,10 +1422,8 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
|
||||
sde_plane_get_property(pstate, PLANE_PROP_V_DECIMATE);
|
||||
|
||||
/* don't chroma subsample if decimating */
|
||||
chroma_subsmpl_h = psde->pipe_cfg.horz_decimation ? 1 :
|
||||
drm_format_horz_chroma_subsampling(fmt->base.pixel_format);
|
||||
chroma_subsmpl_v = psde->pipe_cfg.vert_decimation ? 1 :
|
||||
drm_format_vert_chroma_subsampling(fmt->base.pixel_format);
|
||||
chroma_subsmpl_h = psde->pipe_cfg.horz_decimation ? 1 : info->hsub;
|
||||
chroma_subsmpl_v = psde->pipe_cfg.vert_decimation ? 1 : info->vsub;
|
||||
|
||||
/* update scaler */
|
||||
if (psde->features & BIT(SDE_SSPP_SCALER_QSEED3) ||
|
||||
@@ -4007,8 +4006,6 @@ static void sde_plane_destroy(struct drm_plane *plane)
|
||||
msm_property_destroy(&psde->property_info);
|
||||
mutex_destroy(&psde->lock);
|
||||
|
||||
drm_plane_helper_disable(plane, NULL);
|
||||
|
||||
/* this will destroy the states as well */
|
||||
drm_plane_cleanup(plane);
|
||||
|
||||
|
@@ -1951,7 +1951,7 @@ static void _sde_rm_release_rsvp(
|
||||
void sde_rm_release(struct sde_rm *rm, struct drm_encoder *enc, bool nxt)
|
||||
{
|
||||
struct sde_rm_rsvp *rsvp;
|
||||
struct drm_connector *conn;
|
||||
struct drm_connector *conn = NULL;
|
||||
struct msm_drm_private *priv;
|
||||
struct sde_kms *sde_kms;
|
||||
uint64_t top_ctrl;
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
|
||||
|
||||
#include <uapi/drm/sde_drm.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "msm_kms.h"
|
||||
#include "sde_kms.h"
|
||||
|
Reference in New Issue
Block a user