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";
|
||||
|
||||
if (!display) {
|
||||
SDE_ERROR("[%s]Invalid params\n", display->name);
|
||||
SDE_ERROR("Invalid params\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -240,6 +240,10 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
|
|||
plane->state->fb->base.id : -1);
|
||||
|
||||
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 */
|
||||
if (pstate->stage != SDE_STAGE_BASE) {
|
||||
|
@ -915,6 +919,11 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc)
|
|||
dev = crtc->dev;
|
||||
sde_crtc = to_sde_crtc(crtc);
|
||||
sde_kms = _sde_crtc_get_kms(crtc);
|
||||
if (!sde_kms) {
|
||||
SDE_ERROR("invalid sde_kms\n");
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
dev = crtc->dev;
|
||||
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);
|
||||
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
|
||||
* 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_encoder *encoder;
|
||||
struct drm_device *dev = crtc->dev;
|
||||
struct drm_device *dev;
|
||||
int ret;
|
||||
|
||||
if (!kms || !crtc || !crtc->state) {
|
||||
|
@ -393,6 +393,8 @@ static void sde_kms_wait_for_commit_done(struct msm_kms *kms,
|
|||
return;
|
||||
}
|
||||
|
||||
dev = crtc->dev;
|
||||
|
||||
if (!crtc->state->enable) {
|
||||
SDE_DEBUG("[crtc:%d] not enable\n", crtc->base.id);
|
||||
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
|
||||
* 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->modifier,
|
||||
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,
|
||||
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->modifier,
|
||||
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)) {
|
||||
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,
|
||||
struct sde_plane_state *pstate)
|
||||
{
|
||||
struct sde_plane *psde = pp->sde_plane;
|
||||
struct sde_plane *psde;
|
||||
struct sde_hw_scaler3_cfg *cfg;
|
||||
int ret = 0;
|
||||
|
||||
if (!pp || !pp->scaler3_cfg) {
|
||||
if (!pp || !pp->sde_plane || !pp->scaler3_cfg) {
|
||||
SDE_ERROR("invalid args\n");
|
||||
return -EINVAL;
|
||||
} else if (!pstate) {
|
||||
|
@ -707,6 +716,7 @@ static int _sde_plane_setup_scaler3_lut(struct sde_phy_plane *pp,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
psde = pp->sde_plane;
|
||||
cfg = pp->scaler3_cfg;
|
||||
|
||||
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,
|
||||
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_state *pstate;
|
||||
int rc;
|
||||
|
@ -1461,6 +1471,7 @@ static int sde_plane_prepare_fb(struct drm_plane *plane,
|
|||
if (!new_state->fb)
|
||||
return 0;
|
||||
|
||||
fb = new_state->fb;
|
||||
pstate = to_sde_plane_state(new_state);
|
||||
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_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_plane *psde = to_sde_plane(plane);
|
||||
int zpos_max = 255;
|
||||
|
|
Loading…
Add table
Reference in a new issue