All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Chung <chiahsuan.chung@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <Harry.Wentland@amd.com>, <Sunpeng.Li@amd.com>,
	<Bhawanpreet.Lakha@amd.com>, <Rodrigo.Siqueira@amd.com>,
	<Aurabindo.Pillai@amd.com>, <qingqing.zhuo@amd.com>,
	<roman.li@amd.com>, <wayne.lin@amd.com>, <stylon.wang@amd.com>,
	<solomon.chiu@amd.com>, <pavle.kotarac@amd.com>,
	<agustin.gutierrez@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	<Stable@vger.kernel.org>, Chris Park <Chris.Park@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>
Subject: [PATCH 24/32] drm/amd/display: Check correct bounds for stream encoder instances for DCN303
Date: Sat, 6 Aug 2022 01:58:18 +0800	[thread overview]
Message-ID: <20220805175826.2992171-25-chiahsuan.chung@amd.com> (raw)
In-Reply-To: <20220805175826.2992171-1-chiahsuan.chung@amd.com>

From: Aurabindo Pillai <aurabindo.pillai@amd.com>

[Why & How]
eng_id for DCN303 cannot be more than 1, since we have only two
instances of stream encoders.

Check the correct boundary condition for engine ID for DCN303 prevent
the potential out of bounds access.

Fixes: cd6d421e3d1a ("drm/amd/display: Initial DC support for Beige Goby")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <Stable@vger.kernel.org>

Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
index 0a67f8a5656d..d97076648acb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
@@ -372,7 +372,7 @@ static struct stream_encoder *dcn303_stream_encoder_create(enum engine_id eng_id
 	int afmt_inst;
 
 	/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
-	if (eng_id <= ENGINE_ID_DIGE) {
+	if (eng_id <= ENGINE_ID_DIGB) {
 		vpg_inst = eng_id;
 		afmt_inst = eng_id;
 	} else
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Tom Chung <chiahsuan.chung@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Chris Park <Chris.Park@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	roman.li@amd.com, Stable@vger.kernel.org, solomon.chiu@amd.com,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	wayne.lin@amd.com, Bhawanpreet.Lakha@amd.com,
	agustin.gutierrez@amd.com, pavle.kotarac@amd.com
Subject: [PATCH 24/32] drm/amd/display: Check correct bounds for stream encoder instances for DCN303
Date: Sat, 6 Aug 2022 01:58:18 +0800	[thread overview]
Message-ID: <20220805175826.2992171-25-chiahsuan.chung@amd.com> (raw)
In-Reply-To: <20220805175826.2992171-1-chiahsuan.chung@amd.com>

From: Aurabindo Pillai <aurabindo.pillai@amd.com>

[Why & How]
eng_id for DCN303 cannot be more than 1, since we have only two
instances of stream encoders.

Check the correct boundary condition for engine ID for DCN303 prevent
the potential out of bounds access.

Fixes: cd6d421e3d1a ("drm/amd/display: Initial DC support for Beige Goby")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <Stable@vger.kernel.org>

Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
index 0a67f8a5656d..d97076648acb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
@@ -372,7 +372,7 @@ static struct stream_encoder *dcn303_stream_encoder_create(enum engine_id eng_id
 	int afmt_inst;
 
 	/* Mapping of VPG, AFMT, DME register blocks to DIO block instance */
-	if (eng_id <= ENGINE_ID_DIGE) {
+	if (eng_id <= ENGINE_ID_DIGB) {
 		vpg_inst = eng_id;
 		afmt_inst = eng_id;
 	} else
-- 
2.25.1


  parent reply	other threads:[~2022-08-05 18:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 17:57 [PATCH 00/32] DC Patches July 29 2022 Tom Chung
2022-08-05 17:57 ` [PATCH 01/32] drm/amd/display: Use pixels per container logic for DCN314 DCCG dividers Tom Chung
2022-08-05 17:57 ` [PATCH 02/32] drm/amd/display: Create FPU files for DCN314 Tom Chung
2022-08-05 17:57 ` [PATCH 03/32] drm/amd/display: Move populate dml pipes from DCN314 to dml Tom Chung
2022-08-05 17:57 ` [PATCH 04/32] drm/amd/display: Drop FPU flags from Makefile Tom Chung
2022-08-05 17:57 ` [PATCH 05/32] drm/amd/display: fix CAB allocation for multiple displays Tom Chung
2022-08-05 17:58 ` [PATCH 06/32] drm/amd/display: Revert "fix 32 bit compilation errors in dc_dmub_srv.c" Tom Chung
2022-08-05 17:58 ` [PATCH 07/32] drm/amd/display: Add a variable to update FCLK latency Tom Chung
2022-08-05 17:58 ` [PATCH 08/32] drm/amd/display: Refactor SubVP calculation to remove FPU Tom Chung
2022-08-05 17:58 ` [PATCH 09/32] drm/amd/display: Fix TMDS 4K@60Hz YCbCr420 corruption issue Tom Chung
2022-08-05 17:58 ` [PATCH 10/32] drm/amd/display: Device flash garbage before get in OS Tom Chung
2022-08-05 17:58 ` [PATCH 11/32] drm/amd/display: Add 16 lines margin for SubVP Tom Chung
2022-08-05 17:58 ` [PATCH 12/32] drm/amd/display: Avoid MPC infinite loop Tom Chung
2022-08-05 17:58 ` [PATCH 13/32] drm/amd/display: Fix subvp calculations Tom Chung
2022-08-05 17:58 ` [PATCH 14/32] drm/amd/display: Fix HDMI VSIF V3 incorrect issue Tom Chung
2022-08-05 17:58 ` [PATCH 15/32] drm/amd/display: Add documentation to some of the cursor struct Tom Chung
2022-08-05 17:58 ` [PATCH 16/32] drm/amd/display: Add basic kernel doc to CRC code under DC Tom Chung
2022-08-05 17:58 ` [PATCH 17/32] drm/amd/display: Add some extra kernel doc to amdgpu_dm Tom Chung
2022-08-05 17:58 ` [PATCH 18/32] drm/amd/display: Document pipe split policy Tom Chung
2022-08-05 17:58 ` [PATCH 19/32] drm/amd/display: Expand documentation for timing Tom Chung
2022-08-05 17:58 ` [PATCH 20/32] drm/amd/display: Document some of the DML structs Tom Chung
2022-08-05 17:58 ` [PATCH 21/32] drm/amd/display: Allow alternate prefetch modes in DML for DCN32 Tom Chung
2022-08-05 17:58 ` [PATCH 22/32] drm/amd/display: Fix Compile-time Warning Tom Chung
2022-08-05 17:58 ` [PATCH 23/32] drm/amd/display: Fix VPG instancing for dcn314 HPO Tom Chung
2022-08-05 17:58 ` Tom Chung [this message]
2022-08-05 17:58   ` [PATCH 24/32] drm/amd/display: Check correct bounds for stream encoder instances for DCN303 Tom Chung
2022-08-05 17:58 ` [PATCH 25/32] drm/amd/display: Enable SubVP by default on DCN32 & DCN321 Tom Chung
2022-08-05 17:58 ` [PATCH 26/32] drm/amd/display: Correct DTBCLK for dcn314 Tom Chung
2022-08-05 17:58 ` [PATCH 27/32] drm/amd/display: Revert "attempt to fix the logic in commit_planes_for_stream()" Tom Chung
2022-08-05 17:58 ` [PATCH 28/32] drm/amd/display: For stereo keep "FLIP_ANY_FRAME" Tom Chung
2022-08-05 17:58 ` [PATCH 29/32] drm/amd/display: Don't try to enter MALL SS if stereo3d Tom Chung
2022-08-05 17:58 ` [PATCH 30/32] drm/amd/display: clear optc underflow before turn off odm clock Tom Chung
2022-08-05 17:58 ` [PATCH 31/32] drm/amd/display: Fix TDR eDP and USB4 display light up issue Tom Chung
2022-08-05 17:58 ` [PATCH 32/32] drm/amd/display: 3.2.197 Tom Chung
2022-08-08 15:38 ` [PATCH 00/32] DC Patches July 29 2022 Wheeler, Daniel

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=20220805175826.2992171-25-chiahsuan.chung@amd.com \
    --to=chiahsuan.chung@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Chris.Park@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Stable@vger.kernel.org \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dan.carpenter@oracle.com \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=stylon.wang@amd.com \
    --cc=wayne.lin@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.