stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i195: Fix dbuf slice config lookup
@ 2022-02-07 13:26 Ville Syrjala
  2022-02-07 13:27 ` [PATCH 2/2] drm/i915: Fix mbus join " Ville Syrjala
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ville Syrjala @ 2022-02-07 13:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Apparently I totally fumbled the loop condition when I
removed the ARRAY_SIZE() stuff from the dbuf slice config
lookup. Comparing the loop index with the active_pipes bitmask
is utter nonsense, what we want to do is check to see if the
mask is zero or not.

Cc: stable@vger.kernel.org
Fixes: 05e8155afe35 ("drm/i915: Use a sentinel to terminate the dbuf slice arrays")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 02084652fe3d..da721aea70ff 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4848,7 +4848,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus,
 {
 	int i;
 
-	for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
+	for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
 		if (dbuf_slices[i].active_pipes == active_pipes &&
 		    dbuf_slices[i].join_mbus == join_mbus)
 			return dbuf_slices[i].dbuf_mask[pipe];
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/i915: Fix mbus join config lookup
  2022-02-07 13:26 [PATCH 1/2] drm/i195: Fix dbuf slice config lookup Ville Syrjala
@ 2022-02-07 13:27 ` Ville Syrjala
  2022-02-08 14:10   ` [Intel-gfx] " Jani Nikula
  2022-02-07 16:47 ` [PATCH 1/2] drm/i195: Fix dbuf slice " Ville Syrjälä
  2022-02-08 14:10 ` [Intel-gfx] " Jani Nikula
  2 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjala @ 2022-02-07 13:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The bogus loop from compute_dbuf_slices() was copied into
check_mbus_joined() as well. So this lookup is wrong as well.
Fix it.

Cc: stable@vger.kernel.org
Fixes: f4dc00863226 ("drm/i915/adl_p: MBUS programming")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index da721aea70ff..23d4bb011fc8 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4831,7 +4831,7 @@ static bool check_mbus_joined(u8 active_pipes,
 {
 	int i;
 
-	for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
+	for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
 		if (dbuf_slices[i].active_pipes == active_pipes)
 			return dbuf_slices[i].join_mbus;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/i195: Fix dbuf slice config lookup
  2022-02-07 13:26 [PATCH 1/2] drm/i195: Fix dbuf slice config lookup Ville Syrjala
  2022-02-07 13:27 ` [PATCH 2/2] drm/i915: Fix mbus join " Ville Syrjala
@ 2022-02-07 16:47 ` Ville Syrjälä
  2022-02-08 14:10 ` [Intel-gfx] " Jani Nikula
  2 siblings, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2022-02-07 16:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: stable

On Mon, Feb 07, 2022 at 03:26:59PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Apparently I totally fumbled the loop condition when I
> removed the ARRAY_SIZE() stuff from the dbuf slice config
> lookup. Comparing the loop index with the active_pipes bitmask
> is utter nonsense, what we want to do is check to see if the
> mask is zero or not.
> 
> Cc: stable@vger.kernel.org
> Fixes: 05e8155afe35 ("drm/i915: Use a sentinel to terminate the dbuf slice arrays")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 02084652fe3d..da721aea70ff 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4848,7 +4848,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus,
>  {
>  	int i;
>  
> -	for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
> +	for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {

Actually looks like the tables just happened to be ordered
the right way that the code never did the wrong thing until
commit eef173954432 ("drm/i915: Allow !join_mbus cases for adlp+
dbuf configuration"). So this just needs backporting alongside
that commit (which I flagged for 5.14+), but no crucial need to
backport further than that.

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Intel-gfx] [PATCH 1/2] drm/i195: Fix dbuf slice config lookup
  2022-02-07 13:26 [PATCH 1/2] drm/i195: Fix dbuf slice config lookup Ville Syrjala
  2022-02-07 13:27 ` [PATCH 2/2] drm/i915: Fix mbus join " Ville Syrjala
  2022-02-07 16:47 ` [PATCH 1/2] drm/i195: Fix dbuf slice " Ville Syrjälä
@ 2022-02-08 14:10 ` Jani Nikula
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2022-02-08 14:10 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx; +Cc: stable

On Mon, 07 Feb 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Apparently I totally fumbled the loop condition when I
> removed the ARRAY_SIZE() stuff from the dbuf slice config
> lookup. Comparing the loop index with the active_pipes bitmask
> is utter nonsense, what we want to do is check to see if the
> mask is zero or not.
>
> Cc: stable@vger.kernel.org
> Fixes: 05e8155afe35 ("drm/i915: Use a sentinel to terminate the dbuf slice arrays")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 02084652fe3d..da721aea70ff 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4848,7 +4848,7 @@ static u8 compute_dbuf_slices(enum pipe pipe, u8 active_pipes, bool join_mbus,
>  {
>  	int i;
>  
> -	for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
> +	for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
>  		if (dbuf_slices[i].active_pipes == active_pipes &&
>  		    dbuf_slices[i].join_mbus == join_mbus)
>  			return dbuf_slices[i].dbuf_mask[pipe];

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Intel-gfx] [PATCH 2/2] drm/i915: Fix mbus join config lookup
  2022-02-07 13:27 ` [PATCH 2/2] drm/i915: Fix mbus join " Ville Syrjala
@ 2022-02-08 14:10   ` Jani Nikula
  0 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2022-02-08 14:10 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx; +Cc: stable

On Mon, 07 Feb 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The bogus loop from compute_dbuf_slices() was copied into
> check_mbus_joined() as well. So this lookup is wrong as well.
> Fix it.
>
> Cc: stable@vger.kernel.org
> Fixes: f4dc00863226 ("drm/i915/adl_p: MBUS programming")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index da721aea70ff..23d4bb011fc8 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4831,7 +4831,7 @@ static bool check_mbus_joined(u8 active_pipes,
>  {
>  	int i;
>  
> -	for (i = 0; i < dbuf_slices[i].active_pipes; i++) {
> +	for (i = 0; dbuf_slices[i].active_pipes != 0; i++) {
>  		if (dbuf_slices[i].active_pipes == active_pipes)
>  			return dbuf_slices[i].join_mbus;
>  	}

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-08 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 13:26 [PATCH 1/2] drm/i195: Fix dbuf slice config lookup Ville Syrjala
2022-02-07 13:27 ` [PATCH 2/2] drm/i915: Fix mbus join " Ville Syrjala
2022-02-08 14:10   ` [Intel-gfx] " Jani Nikula
2022-02-07 16:47 ` [PATCH 1/2] drm/i195: Fix dbuf slice " Ville Syrjälä
2022-02-08 14:10 ` [Intel-gfx] " Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).