[PATCH v4 4/9] drm/i915/display: accept either i915 or display for feature tests

Rodrigo Vivi rodrigo.vivi at intel.com
Wed Apr 17 13:58:33 UTC 2024


On Wed, Apr 17, 2024 at 04:02:42PM +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.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_display_device.h | 5 +++--
>  1 file 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..17ddf82f0b6e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -8,6 +8,7 @@
>  
>  #include <linux/types.h>
>  
> +#include "intel_display_conversion.h"
>  #include "intel_display_limits.h"
>  
>  struct drm_i915_private;
> @@ -100,8 +101,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, \
> -- 
> 2.39.2
> 


More information about the Intel-gfx mailing list