diff mbox series

[v6,11/11] drm/v3d: Expose Super Pages capability

Message ID 20240923141348.2422499-12-mcanal@igalia.com (mailing list archive)
State New, archived
Headers show
Series drm/v3d: Enable Big and Super Pages | expand

Commit Message

Maíra Canal Sept. 23, 2024, 1:55 p.m. UTC
Add a new V3D parameter to expose the support of Super Pages to
userspace. The userspace might want to know this information to
apply optimizations that are specific to kernels with Super Pages
enabled.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_drv.c | 3 +++
 include/uapi/drm/v3d_drm.h    | 1 +
 2 files changed, 4 insertions(+)

Comments

Iago Toral Sept. 24, 2024, 5:30 a.m. UTC | #1
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>

El lun, 23-09-2024 a las 10:55 -0300, Maíra Canal escribió:
> Add a new V3D parameter to expose the support of Super Pages to
> userspace. The userspace might want to know this information to
> apply optimizations that are specific to kernels with Super Pages
> enabled.
> 
> Signed-off-by: Maíra Canal <mcanal@igalia.com>
> ---
>  drivers/gpu/drm/v3d/v3d_drv.c | 3 +++
>  include/uapi/drm/v3d_drm.h    | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.c
> b/drivers/gpu/drm/v3d/v3d_drv.c
> index 8be8c6dd9b35..fb35c5c3f1a7 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.c
> +++ b/drivers/gpu/drm/v3d/v3d_drv.c
> @@ -104,6 +104,9 @@ static int v3d_get_param_ioctl(struct drm_device
> *dev, void *data,
>  	case DRM_V3D_PARAM_MAX_PERF_COUNTERS:
>  		args->value = v3d->perfmon_info.max_counters;
>  		return 0;
> +	case DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES:
> +		args->value = !!v3d->gemfs;
> +		return 0;
>  	default:
>  		DRM_DEBUG("Unknown parameter %d\n", args->param);
>  		return -EINVAL;
> diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
> index 87fc5bb0a61e..2376c73abca1 100644
> --- a/include/uapi/drm/v3d_drm.h
> +++ b/include/uapi/drm/v3d_drm.h
> @@ -290,6 +290,7 @@ enum drm_v3d_param {
>  	DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
>  	DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
>  	DRM_V3D_PARAM_MAX_PERF_COUNTERS,
> +	DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES,
>  };
>  
>  struct drm_v3d_get_param {
Maíra Canal Sept. 25, 2024, 12:20 p.m. UTC | #2
Hi Iago,

On 9/24/24 02:30, Iago Toral wrote:
> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>

I just applied to misc/kernel.git (drm-misc-next).

Thank you and Tvrtko for all the help during the reviewing process!

Best Regards,
- Maíra

> 
> El lun, 23-09-2024 a las 10:55 -0300, Maíra Canal escribió:
>> Add a new V3D parameter to expose the support of Super Pages to
>> userspace. The userspace might want to know this information to
>> apply optimizations that are specific to kernels with Super Pages
>> enabled.
>>
>> Signed-off-by: Maíra Canal <mcanal@igalia.com>
>> ---
>>   drivers/gpu/drm/v3d/v3d_drv.c | 3 +++
>>   include/uapi/drm/v3d_drm.h    | 1 +
>>   2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/v3d/v3d_drv.c
>> b/drivers/gpu/drm/v3d/v3d_drv.c
>> index 8be8c6dd9b35..fb35c5c3f1a7 100644
>> --- a/drivers/gpu/drm/v3d/v3d_drv.c
>> +++ b/drivers/gpu/drm/v3d/v3d_drv.c
>> @@ -104,6 +104,9 @@ static int v3d_get_param_ioctl(struct drm_device
>> *dev, void *data,
>>   	case DRM_V3D_PARAM_MAX_PERF_COUNTERS:
>>   		args->value = v3d->perfmon_info.max_counters;
>>   		return 0;
>> +	case DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES:
>> +		args->value = !!v3d->gemfs;
>> +		return 0;
>>   	default:
>>   		DRM_DEBUG("Unknown parameter %d\n", args->param);
>>   		return -EINVAL;
>> diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
>> index 87fc5bb0a61e..2376c73abca1 100644
>> --- a/include/uapi/drm/v3d_drm.h
>> +++ b/include/uapi/drm/v3d_drm.h
>> @@ -290,6 +290,7 @@ enum drm_v3d_param {
>>   	DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
>>   	DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
>>   	DRM_V3D_PARAM_MAX_PERF_COUNTERS,
>> +	DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES,
>>   };
>>   
>>   struct drm_v3d_get_param {
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 8be8c6dd9b35..fb35c5c3f1a7 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -104,6 +104,9 @@  static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
 	case DRM_V3D_PARAM_MAX_PERF_COUNTERS:
 		args->value = v3d->perfmon_info.max_counters;
 		return 0;
+	case DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES:
+		args->value = !!v3d->gemfs;
+		return 0;
 	default:
 		DRM_DEBUG("Unknown parameter %d\n", args->param);
 		return -EINVAL;
diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
index 87fc5bb0a61e..2376c73abca1 100644
--- a/include/uapi/drm/v3d_drm.h
+++ b/include/uapi/drm/v3d_drm.h
@@ -290,6 +290,7 @@  enum drm_v3d_param {
 	DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
 	DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
 	DRM_V3D_PARAM_MAX_PERF_COUNTERS,
+	DRM_V3D_PARAM_SUPPORTS_SUPER_PAGES,
 };
 
 struct drm_v3d_get_param {