Re: [Intel-gfx] [PATCH 1/3] drm/i915: disable all display features when no display

2020-09-11 Thread Jani Nikula
On Thu, 10 Sep 2020, Ville Syrjälä  wrote:
> On Thu, Sep 10, 2020 at 12:52:25PM +0300, Jani Nikula wrote:
>> Disable all display feature flags when there are no pipes i.e. there is
>> no display. This should help with not having to additionally check for
>> HAS_DISPLAY() when a feature flag check would suffice.
>> 
>> Also disable modeset and atomic driver features.
>
> While bspec is rather vague whether this is actually entirely consistent
> with how th hw works, it seems rather silly if any display hw blocks
> would get initialized by the BIOS/whatever when there are no usable
> pipes.
>
> Reviewed-by: Ville Syrjälä 

Pushed the lot, thanks for the reviews.

BR,
Jani.

>
>> 
>> Cc: Ville Syrjälä 
>> Signed-off-by: Jani Nikula 
>> ---
>>  drivers/gpu/drm/i915/intel_device_info.c | 8 
>>  1 file changed, 8 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_device_info.c 
>> b/drivers/gpu/drm/i915/intel_device_info.c
>> index e2aa5bc3a6e0..adc836f15fde 100644
>> --- a/drivers/gpu/drm/i915/intel_device_info.c
>> +++ b/drivers/gpu/drm/i915/intel_device_info.c
>> @@ -516,6 +516,14 @@ void intel_device_info_runtime_init(struct 
>> drm_i915_private *dev_priv)
>>  S32_MAX),
>>  USEC_PER_SEC));
>>  }
>> +
>> +if (!HAS_DISPLAY(dev_priv)) {
>> +dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
>> +   DRIVER_ATOMIC);
>> +memset(&info->display, 0, sizeof(info->display));
>> +memset(runtime->num_sprites, 0, sizeof(runtime->num_sprites));
>> +memset(runtime->num_scalers, 0, sizeof(runtime->num_scalers));
>
> Side note: No idea why the num_scalers/sprites is stored under the
> runtime info. I think those could just live in the normal PCI ID
> based device info.
>
>> +}
>>  }
>>  
>>  void intel_driver_caps_print(const struct intel_driver_caps *caps,
>> -- 
>> 2.20.1

-- 
Jani Nikula, Intel Open Source Graphics Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/3] drm/i915: disable all display features when no display

2020-09-10 Thread Ville Syrjälä
On Thu, Sep 10, 2020 at 12:52:25PM +0300, Jani Nikula wrote:
> Disable all display feature flags when there are no pipes i.e. there is
> no display. This should help with not having to additionally check for
> HAS_DISPLAY() when a feature flag check would suffice.
> 
> Also disable modeset and atomic driver features.

While bspec is rather vague whether this is actually entirely consistent
with how th hw works, it seems rather silly if any display hw blocks
would get initialized by the BIOS/whatever when there are no usable
pipes.

Reviewed-by: Ville Syrjälä 

> 
> Cc: Ville Syrjälä 
> Signed-off-by: Jani Nikula 
> ---
>  drivers/gpu/drm/i915/intel_device_info.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c 
> b/drivers/gpu/drm/i915/intel_device_info.c
> index e2aa5bc3a6e0..adc836f15fde 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -516,6 +516,14 @@ void intel_device_info_runtime_init(struct 
> drm_i915_private *dev_priv)
>   S32_MAX),
>   USEC_PER_SEC));
>   }
> +
> + if (!HAS_DISPLAY(dev_priv)) {
> + dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
> +DRIVER_ATOMIC);
> + memset(&info->display, 0, sizeof(info->display));
> + memset(runtime->num_sprites, 0, sizeof(runtime->num_sprites));
> + memset(runtime->num_scalers, 0, sizeof(runtime->num_scalers));

Side note: No idea why the num_scalers/sprites is stored under the
runtime info. I think those could just live in the normal PCI ID
based device info.

> + }
>  }
>  
>  void intel_driver_caps_print(const struct intel_driver_caps *caps,
> -- 
> 2.20.1

-- 
Ville Syrjälä
Intel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/3] drm/i915: disable all display features when no display

2020-09-10 Thread Jani Nikula
Disable all display feature flags when there are no pipes i.e. there is
no display. This should help with not having to additionally check for
HAS_DISPLAY() when a feature flag check would suffice.

Also disable modeset and atomic driver features.

Cc: Ville Syrjälä 
Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/intel_device_info.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_device_info.c 
b/drivers/gpu/drm/i915/intel_device_info.c
index e2aa5bc3a6e0..adc836f15fde 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -516,6 +516,14 @@ void intel_device_info_runtime_init(struct 
drm_i915_private *dev_priv)
S32_MAX),
USEC_PER_SEC));
}
+
+   if (!HAS_DISPLAY(dev_priv)) {
+   dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
+  DRIVER_ATOMIC);
+   memset(&info->display, 0, sizeof(info->display));
+   memset(runtime->num_sprites, 0, sizeof(runtime->num_sprites));
+   memset(runtime->num_scalers, 0, sizeof(runtime->num_scalers));
+   }
 }
 
 void intel_driver_caps_print(const struct intel_driver_caps *caps,
-- 
2.20.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx