Re: [PATCH v3 5/7] drm/i915/display: accept either i915 or display for feature tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Apr 2024, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> wrote:
> On Tue, Apr 09, 2024 at 03:26:47PM +0300, Jani Nikula wrote:
>> Use the generic __to_intel_display() to allow passing either struct
>> drm_i915_private * or struct intel_display * to the feature test macros.
>> 
>> Unfortunately, this requires including i915_drv.h in xe display
>> code. This is still better than polluting the main xe_device.h or
>> xe_device_types.h files with the __to_intel_display() macro definition.
>
> what about just duplicating these 2 lines in a compat layer
> (perhaps a new temporary one?) and the only including that
> instead of bringing it entirely?

Added a shared header under display for __to_intel_display(), and the
change in xe can be dropped.

BR,
Jani.


>
> or what else wouldbe needed?
>
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display_device.h | 4 ++--
>>  drivers/gpu/drm/xe/display/xe_hdcp_gsc.c            | 1 +
>>  2 files changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
>> index 66b51de86e38..01c6a4bef179 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
>> @@ -100,8 +100,8 @@ struct drm_printer;
>>  	(IS_DISPLAY_IP_RANGE((__i915), (ipver), (ipver)) && \
>>  	 IS_DISPLAY_STEP((__i915), (from), (until)))
>>  
>> -#define DISPLAY_INFO(i915)		((i915)->display.info.__device_info)
>> -#define DISPLAY_RUNTIME_INFO(i915)	(&(i915)->display.info.__runtime_info)
>> +#define DISPLAY_INFO(i915)		(__to_intel_display(i915)->info.__device_info)
>> +#define DISPLAY_RUNTIME_INFO(i915)	(&__to_intel_display(i915)->info.__runtime_info)
>>  
>>  #define DISPLAY_VER(i915)	(DISPLAY_RUNTIME_INFO(i915)->ip.ver)
>>  #define DISPLAY_VER_FULL(i915)	IP_VER(DISPLAY_RUNTIME_INFO(i915)->ip.ver, \
>> diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
>> index ac4b870f73fa..54314760f47a 100644
>> --- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
>> +++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
>> @@ -19,6 +19,7 @@
>>  #include "xe_map.h"
>>  #include "xe_pm.h"
>>  #include "xe_uc_fw.h"
>> +#include "i915_drv.h"
>>  
>>  #define HECI_MEADDRESS_HDCP 18
>>  
>> -- 
>> 2.39.2
>> 

-- 
Jani Nikula, Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux