[Intel-xe] [PATCH v2 2/6] drm/i915: Convert INTEL_INFO()->display to a pointer
Jani Nikula
jani.nikula at linux.intel.com
Tue May 23 12:47:46 UTC 2023
On Mon, 22 May 2023, Matt Roper <matthew.d.roper at intel.com> wrote:
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 4e23be2995bf..d0bf626d0360 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -138,7 +138,7 @@ void intel_device_info_print(const struct intel_device_info *info,
>
> drm_printf(p, "has_pooled_eu: %s\n", str_yes_no(runtime->has_pooled_eu));
>
> -#define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, str_yes_no(info->display.name))
> +#define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, str_yes_no(info->display->name))
> DEV_INFO_DISPLAY_FOR_EACH_FLAG(PRINT_FLAG);
> #undef PRINT_FLAG
>
> @@ -388,6 +388,8 @@ mkwrite_device_info(struct drm_i915_private *i915)
> return (struct intel_device_info *)INTEL_INFO(i915);
> }
>
> +static const struct intel_display_device_info no_display = { 0 };
I think {} is preferred. Can be fixed afterwards if there's no other
reason to do a respin.
> +
> /**
> * intel_device_info_runtime_init - initialize runtime info
> * @dev_priv: the i915 device
> @@ -538,7 +540,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
> if (!HAS_DISPLAY(dev_priv)) {
> dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
> DRIVER_ATOMIC);
> - memset(&info->display, 0, sizeof(info->display));
> + info->display = &no_display;
Nice!
Acked-by: Jani Nikula <jani.nikula at intel.com>
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-xe
mailing list