From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
David Francis <David.Francis@amd.com>,
Roman Li <Roman.Li@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Subject: [PATCH AUTOSEL 5.2 022/171] drm/amd/display: Fill plane attrs only for valid pxl format
Date: Thu, 18 Jul 2019 23:54:13 -0400 [thread overview]
Message-ID: <20190719035643.14300-22-sashal@kernel.org> (raw)
In-Reply-To: <20190719035643.14300-1-sashal@kernel.org>
From: Roman Li <Roman.Li@amd.com>
[ Upstream commit 1894478ad1f8fd7366edc5cee49ee9caea0e3d52 ]
[Why]
In fill_plane_buffer_attributes() we calculate chroma/luma
assuming that the surface_pixel_format is always valid.
If it's not the case, there's a risk of divide by zero error.
[How]
Check if format valid before calculating pixel format attributes
Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index fa268dd736f4..31530bfd002a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2592,7 +2592,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev,
address->type = PLN_ADDR_TYPE_GRAPHICS;
address->grph.addr.low_part = lower_32_bits(afb->address);
address->grph.addr.high_part = upper_32_bits(afb->address);
- } else {
+ } else if (format < SURFACE_PIXEL_FORMAT_INVALID) {
uint64_t chroma_addr = afb->address + fb->offsets[1];
plane_size->video.luma_size.x = 0;
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-07-19 3:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190719035643.14300-1-sashal@kernel.org>
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 018/171] drm/amd/display: Fill prescale_params->scale for RGB565 Sasha Levin
2019-07-19 3:54 ` Sasha Levin [this message]
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 023/171] drm/amdgpu: Reserve shared fence for eviction fence Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 036/171] drm/amd/display: CS_TFM_1D only applied post EOTF Sasha Levin
[not found] ` <20190719035643.14300-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 019/171] drm/amd/display: fix multi display seamless boot case Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 021/171] drm/amd/display: Disable cursor when offscreen in negative direction Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 025/171] drm/amdgpu/sriov: Need to initialize the HDP_NONSURFACE_BAStE Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 026/171] drm/amd/display: Disable ABM before destroy ABM struct Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 027/171] drm/amdkfd: Fix a potential memory leak Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 028/171] drm/amdkfd: Fix sdma queue map issue Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 035/171] drm/amd/display: Reset planes for color management changes Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 037/171] drm/amd/display: Increase Backlight Gain Step Size Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 052/171] drm/amd/display: Always allocate initial connector state state Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 053/171] drm/amd/display: Update link rate from DPCD 10 Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 055/171] drm/amd/display: set link->dongle_max_pix_clk to 0 on a disconnect Sasha Levin
2019-07-19 3:54 ` [PATCH AUTOSEL 5.2 057/171] drm/amd/display: fix compilation error Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190719035643.14300-22-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=David.Francis@amd.com \
--cc=Roman.Li@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox