Merge "drm: msm: sde: fix potential NULL pointer dereference"
This commit is contained in:
commit
05a93365d7
4 changed files with 34 additions and 8 deletions
|
@ -1704,7 +1704,7 @@ static int _sde_hdmi_ext_disp_init(struct sde_hdmi *display)
|
||||||
const char *phandle = "qcom,msm_ext_disp";
|
const char *phandle = "qcom,msm_ext_disp";
|
||||||
|
|
||||||
if (!display) {
|
if (!display) {
|
||||||
SDE_ERROR("[%s]Invalid params\n", display->name);
|
SDE_ERROR("Invalid params\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,6 +240,10 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
|
||||||
plane->state->fb->base.id : -1);
|
plane->state->fb->base.id : -1);
|
||||||
|
|
||||||
format = to_sde_format(msm_framebuffer_format(pstate->base.fb));
|
format = to_sde_format(msm_framebuffer_format(pstate->base.fb));
|
||||||
|
if (!format) {
|
||||||
|
SDE_ERROR("%s: get sde format failed\n", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* blend config update */
|
/* blend config update */
|
||||||
if (pstate->stage != SDE_STAGE_BASE) {
|
if (pstate->stage != SDE_STAGE_BASE) {
|
||||||
|
@ -915,6 +919,11 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
|
||||||
dev = crtc->dev;
|
dev = crtc->dev;
|
||||||
sde_crtc = to_sde_crtc(crtc);
|
sde_crtc = to_sde_crtc(crtc);
|
||||||
sde_kms = _sde_crtc_get_kms(crtc);
|
sde_kms = _sde_crtc_get_kms(crtc);
|
||||||
|
if (!sde_kms) {
|
||||||
|
SDE_ERROR("invalid sde_kms\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
priv = sde_kms->dev->dev_private;
|
priv = sde_kms->dev->dev_private;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1543,6 +1552,10 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc,
|
||||||
sde_crtc = to_sde_crtc(crtc);
|
sde_crtc = to_sde_crtc(crtc);
|
||||||
dev = crtc->dev;
|
dev = crtc->dev;
|
||||||
sde_kms = _sde_crtc_get_kms(crtc);
|
sde_kms = _sde_crtc_get_kms(crtc);
|
||||||
|
if (!sde_kms) {
|
||||||
|
SDE_ERROR("invalid sde_kms\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
info = kzalloc(sizeof(struct sde_kms_info), GFP_KERNEL);
|
info = kzalloc(sizeof(struct sde_kms_info), GFP_KERNEL);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (C) 2013 Red Hat
|
* Copyright (C) 2013 Red Hat
|
||||||
* Author: Rob Clark <robdclark@gmail.com>
|
* Author: Rob Clark <robdclark@gmail.com>
|
||||||
*
|
*
|
||||||
|
@ -385,7 +385,7 @@ static void sde_kms_wait_for_commit_done(struct msm_kms *kms,
|
||||||
struct drm_crtc *crtc)
|
struct drm_crtc *crtc)
|
||||||
{
|
{
|
||||||
struct drm_encoder *encoder;
|
struct drm_encoder *encoder;
|
||||||
struct drm_device *dev = crtc->dev;
|
struct drm_device *dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!kms || !crtc || !crtc->state) {
|
if (!kms || !crtc || !crtc->state) {
|
||||||
|
@ -393,6 +393,8 @@ static void sde_kms_wait_for_commit_done(struct msm_kms *kms,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev = crtc->dev;
|
||||||
|
|
||||||
if (!crtc->state->enable) {
|
if (!crtc->state->enable) {
|
||||||
SDE_DEBUG("[crtc:%d] not enable\n", crtc->base.id);
|
SDE_DEBUG("[crtc:%d] not enable\n", crtc->base.id);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2014-2017 The Linux Foundation. All rights reserved.
|
* Copyright (C) 2014-2018 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (C) 2013 Red Hat
|
* Copyright (C) 2013 Red Hat
|
||||||
* Author: Rob Clark <robdclark@gmail.com>
|
* Author: Rob Clark <robdclark@gmail.com>
|
||||||
*
|
*
|
||||||
|
@ -303,6 +303,11 @@ static void _sde_plane_set_qos_lut(struct sde_phy_plane *pp,
|
||||||
fb->pixel_format,
|
fb->pixel_format,
|
||||||
fb->modifier,
|
fb->modifier,
|
||||||
drm_format_num_planes(fb->pixel_format));
|
drm_format_num_planes(fb->pixel_format));
|
||||||
|
if (!fmt) {
|
||||||
|
SDE_ERROR("%s: faile to get fmt\n", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
total_fl = _sde_plane_calc_fill_level(pp, fmt,
|
total_fl = _sde_plane_calc_fill_level(pp, fmt,
|
||||||
pp->pipe_cfg.src_rect.w);
|
pp->pipe_cfg.src_rect.w);
|
||||||
|
|
||||||
|
@ -362,6 +367,10 @@ static void _sde_plane_set_danger_lut(struct sde_phy_plane *pp,
|
||||||
fb->pixel_format,
|
fb->pixel_format,
|
||||||
fb->modifier,
|
fb->modifier,
|
||||||
drm_format_num_planes(fb->pixel_format));
|
drm_format_num_planes(fb->pixel_format));
|
||||||
|
if (!fmt) {
|
||||||
|
SDE_ERROR("%s: fail to get fmt\n", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (SDE_FORMAT_IS_LINEAR(fmt)) {
|
if (SDE_FORMAT_IS_LINEAR(fmt)) {
|
||||||
danger_lut = pp->pipe_sblk->danger_lut_linear;
|
danger_lut = pp->pipe_sblk->danger_lut_linear;
|
||||||
|
@ -694,11 +703,11 @@ static inline void _sde_plane_set_scanout(struct sde_phy_plane *pp,
|
||||||
static int _sde_plane_setup_scaler3_lut(struct sde_phy_plane *pp,
|
static int _sde_plane_setup_scaler3_lut(struct sde_phy_plane *pp,
|
||||||
struct sde_plane_state *pstate)
|
struct sde_plane_state *pstate)
|
||||||
{
|
{
|
||||||
struct sde_plane *psde = pp->sde_plane;
|
struct sde_plane *psde;
|
||||||
struct sde_hw_scaler3_cfg *cfg;
|
struct sde_hw_scaler3_cfg *cfg;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!pp || !pp->scaler3_cfg) {
|
if (!pp || !pp->sde_plane || !pp->scaler3_cfg) {
|
||||||
SDE_ERROR("invalid args\n");
|
SDE_ERROR("invalid args\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else if (!pstate) {
|
} else if (!pstate) {
|
||||||
|
@ -707,6 +716,7 @@ static int _sde_plane_setup_scaler3_lut(struct sde_phy_plane *pp,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
psde = pp->sde_plane;
|
||||||
cfg = pp->scaler3_cfg;
|
cfg = pp->scaler3_cfg;
|
||||||
|
|
||||||
cfg->dir_lut = msm_property_get_blob(
|
cfg->dir_lut = msm_property_get_blob(
|
||||||
|
@ -1450,7 +1460,7 @@ static int _sde_plane_mode_set(struct drm_plane *plane,
|
||||||
static int sde_plane_prepare_fb(struct drm_plane *plane,
|
static int sde_plane_prepare_fb(struct drm_plane *plane,
|
||||||
const struct drm_plane_state *new_state)
|
const struct drm_plane_state *new_state)
|
||||||
{
|
{
|
||||||
struct drm_framebuffer *fb = new_state->fb;
|
struct drm_framebuffer *fb;
|
||||||
struct sde_plane *psde = to_sde_plane(plane);
|
struct sde_plane *psde = to_sde_plane(plane);
|
||||||
struct sde_plane_state *pstate;
|
struct sde_plane_state *pstate;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -1461,6 +1471,7 @@ static int sde_plane_prepare_fb(struct drm_plane *plane,
|
||||||
if (!new_state->fb)
|
if (!new_state->fb)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
fb = new_state->fb;
|
||||||
pstate = to_sde_plane_state(new_state);
|
pstate = to_sde_plane_state(new_state);
|
||||||
rc = _sde_plane_get_aspace(psde, pstate, &psde->aspace);
|
rc = _sde_plane_get_aspace(psde, pstate, &psde->aspace);
|
||||||
|
|
||||||
|
@ -1800,7 +1811,7 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
|
||||||
{SDE_DRM_FB_NON_SEC_DIR_TRANS, "non_sec_direct_translation"},
|
{SDE_DRM_FB_NON_SEC_DIR_TRANS, "non_sec_direct_translation"},
|
||||||
{SDE_DRM_FB_SEC_DIR_TRANS, "sec_direct_translation"},
|
{SDE_DRM_FB_SEC_DIR_TRANS, "sec_direct_translation"},
|
||||||
};
|
};
|
||||||
const struct sde_format_extended *format_list;
|
const struct sde_format_extended *format_list = NULL;
|
||||||
struct sde_kms_info *info;
|
struct sde_kms_info *info;
|
||||||
struct sde_plane *psde = to_sde_plane(plane);
|
struct sde_plane *psde = to_sde_plane(plane);
|
||||||
int zpos_max = 255;
|
int zpos_max = 255;
|
||||||
|
|
Loading…
Add table
Reference in a new issue