diff mbox series

[v4,2/2] drm/debugfs: also take per device driver features into account

Message ID 20200123124801.14958-2-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [v4,1/2] drm: add drm_core_check_all_features() to check for a mask of features | expand

Commit Message

Jani Nikula Jan. 23, 2020, 12:48 p.m. UTC
Use drm_core_check_all_features() to ensure both the driver features and
the per-device driver features are taken into account when registering
debugfs files.

v3:
- files[i].driver_features == 0 actually means "don't care"

v2:
- use drm_core_check_all_features()

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thomas Zimmermann Jan. 23, 2020, 2:06 p.m. UTC | #1
Am 23.01.20 um 13:48 schrieb Jani Nikula:
> Use drm_core_check_all_features() to ensure both the driver features and
> the per-device driver features are taken into account when registering
> debugfs files.
> 
> v3:
> - files[i].driver_features == 0 actually means "don't care"
> 
> v2:
> - use drm_core_check_all_features()
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/drm_debugfs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index eab0f2687cd6..4e673d318503 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -182,8 +182,7 @@ int drm_debugfs_create_files(const struct drm_info_list *files, int count,
>  	for (i = 0; i < count; i++) {
>  		u32 features = files[i].driver_features;
>  
> -		if (features != 0 &&
> -		    (dev->driver->driver_features & features) != features)
> +		if (features && !drm_core_check_all_features(dev, features))
>  			continue;

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

>  
>  		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
>
Jani Nikula Jan. 25, 2020, 2:07 p.m. UTC | #2
On Thu, 23 Jan 2020, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Am 23.01.20 um 13:48 schrieb Jani Nikula:
>> Use drm_core_check_all_features() to ensure both the driver features and
>> the per-device driver features are taken into account when registering
>> debugfs files.
>> 
>> v3:
>> - files[i].driver_features == 0 actually means "don't care"
>> 
>> v2:
>> - use drm_core_check_all_features()
>> 
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/drm_debugfs.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
>> index eab0f2687cd6..4e673d318503 100644
>> --- a/drivers/gpu/drm/drm_debugfs.c
>> +++ b/drivers/gpu/drm/drm_debugfs.c
>> @@ -182,8 +182,7 @@ int drm_debugfs_create_files(const struct drm_info_list *files, int count,
>>  	for (i = 0; i < count; i++) {
>>  		u32 features = files[i].driver_features;
>>  
>> -		if (features != 0 &&
>> -		    (dev->driver->driver_features & features) != features)
>> +		if (features && !drm_core_check_all_features(dev, features))
>>  			continue;
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

Thanks for the review, both pushed to drm-misc-next.

BR,
Jani.


>
>>  
>>  		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index eab0f2687cd6..4e673d318503 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -182,8 +182,7 @@  int drm_debugfs_create_files(const struct drm_info_list *files, int count,
 	for (i = 0; i < count; i++) {
 		u32 features = files[i].driver_features;
 
-		if (features != 0 &&
-		    (dev->driver->driver_features & features) != features)
+		if (features && !drm_core_check_all_features(dev, features))
 			continue;
 
 		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);