Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	<intel-gfx@lists.freedesktop.org>
Cc: <intel-xe@lists.freedesktop.org>, <gustavo.sousa@intel.com>
Subject: Re: [PATCH 1/2] drm/i915/display_wa: Add helpers to check wa
Date: Mon, 30 Jun 2025 13:24:31 +0530	[thread overview]
Message-ID: <fc2e05a3-c6cd-403f-88c8-cbffdc205940@intel.com> (raw)
In-Reply-To: <80a481128d5f979c59c4c5c6856452969d014474@intel.com>


On 6/30/2025 12:53 PM, Jani Nikula wrote:
> On Mon, 30 Jun 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
>> Introduce a generic helper to check display workarounds using an enum.
>>
>> Convert Wa_16023588340 to use the new interface, simplifying WA checks
>> and making future additions easier.
>>
>> Suggested-by: Jani Nikula <jani.nikula@intel.com>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_display_wa.c | 13 +++++++++++++
>>   drivers/gpu/drm/i915/display/intel_display_wa.h |  9 +++++++++
>>   drivers/gpu/drm/i915/display/intel_fbc.c        |  2 +-
>>   3 files changed, 23 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c b/drivers/gpu/drm/i915/display/intel_display_wa.c
>> index f57280e9d041..70ba66fc7e26 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_wa.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
>> @@ -39,3 +39,16 @@ void intel_display_wa_apply(struct intel_display *display)
>>   	else if (DISPLAY_VER(display) == 11)
>>   		gen11_display_wa_apply(display);
>>   }
>> +
>> +bool __intel_display_wa(struct intel_display *display, enum intel_display_wa wa)
>> +{
>> +	switch (wa) {
>> +	case INTEL_DISPLAY_WA_16023588340:
>> +		return intel_display_needs_wa_16023588340(display);
>> +	default:
>> +		MISSING_CASE(wa);
> MISSING_CASE() is a bit of a problem for i915 and display
> separation. Please let's not add more. Use drm_WARN() or something.

Sure. Will get rid of the MISSING_CASE().


>
>> +		break;
>> +	}
>> +
>> +	return false;
>> +}
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.h b/drivers/gpu/drm/i915/display/intel_display_wa.h
>> index babd9d16603d..853939ebf1ac 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_wa.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_wa.h
>> @@ -7,6 +7,7 @@
>>   #define __INTEL_DISPLAY_WA_H__
>>   
>>   #include <linux/types.h>
>> +#include <i915_utils.h>
> Please don't put that in the header. And shouldn't be needed anyway if
> you drop the MISSING_CASE().

Alright will remove this header file.


>
>>   
>>   struct intel_display;
>>   
>> @@ -21,4 +22,12 @@ static inline bool intel_display_needs_wa_16023588340(struct intel_display *disp
>>   bool intel_display_needs_wa_16023588340(struct intel_display *display);
>>   #endif
>>   
>> +enum intel_display_wa {
>> +	INTEL_DISPLAY_WA_16023588340,
>> +};
>> +
>> +bool __intel_display_wa(struct intel_display *display, enum intel_display_wa wa);
>> +
>> +#define _intel_display_wa_expand(__wa) INTEL_DISPLAY_WA_##__wa
> Can't we just do this inline instead of adding another macro?

Yes sure will use :

#define intel_display_wa(__display, __wa) \
         __intel_display_wa((__display), INTEL_DISPLAY_WA_##__wa)


Thanks & Regards,

Ankit

>
>> +#define intel_display_wa(__display, __wa) __intel_display_wa((__display), _intel_display_wa_expand(__wa))
>>   #endif
>> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
>> index ec1ef8694c35..f4b7ff549fd4 100644
>> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
>> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
>> @@ -1464,7 +1464,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
>>   		return 0;
>>   	}
>>   
>> -	if (intel_display_needs_wa_16023588340(display)) {
>> +	if (intel_display_wa(display, 16023588340)) {
>>   		plane_state->no_fbc_reason = "Wa_16023588340";
>>   		return 0;
>>   	}

  reply	other threads:[~2025-06-30  7:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30  5:49 [PATCH 0/2] Introduce helper for display workarounds and add Wa_16025573575 Ankit Nautiyal
2025-06-30  5:49 ` [PATCH 1/2] drm/i915/display_wa: Add helpers to check wa Ankit Nautiyal
2025-06-30  7:23   ` Jani Nikula
2025-06-30  7:54     ` Nautiyal, Ankit K [this message]
2025-06-30  5:49 ` [PATCH 2/2] drm/i915/gmbus: Add Wa_16025573575 for PTL for bit-bashing Ankit Nautiyal
2025-06-30 22:43 ` ✗ CI.checkpatch: warning for Introduce helper for display workarounds and add Wa_16025573575 Patchwork
2025-06-30 22:45 ` ✓ CI.KUnit: success " Patchwork
2025-06-30 23:43 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-02  8:33 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-07-02  8:46 [PATCH 0/2] " Ankit Nautiyal
2025-07-02  8:46 ` [PATCH 1/2] drm/i915/display_wa: Add helpers to check wa Ankit Nautiyal
2025-07-02  9:29   ` Jani Nikula
2025-07-02 13:30   ` Gustavo Sousa
2025-07-02 14:12     ` Jani Nikula
2025-07-03  6:19       ` Nautiyal, Ankit K
2025-07-02 19:40   ` Ville Syrjälä
2025-07-02 20:25     ` Lucas De Marchi
2025-07-02 21:29       ` Ville Syrjälä
2025-07-02 21:49         ` Ville Syrjälä
2025-07-03  9:30           ` Nautiyal, Ankit K
2025-07-03 12:14             ` Gustavo Sousa
2025-07-03 13:51             ` Lucas De Marchi
2025-07-03 12:08           ` Gustavo Sousa
2025-07-03 13:55             ` Lucas De Marchi
2025-07-03 14:44               ` Gustavo Sousa
2025-07-11  4:18 [PATCH 0/2] Introduce helper for display workarounds and add Wa_16025573575 Ankit Nautiyal
2025-07-11  4:18 ` [PATCH 1/2] drm/i915/display_wa: Add helpers to check wa Ankit Nautiyal
2025-07-16 14:18   ` Gustavo Sousa

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=fc2e05a3-c6cd-403f-88c8-cbffdc205940@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox