dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault
@ 2026-09-03 23:16 Jonathan Cavitt
  2026-09-03 23:22 ` sashiko-bot
  2026-09-04  0:16 ` Matthew Brost
  0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Cavitt @ 2026-09-03 23:16 UTC (permalink / raw)
  To: dri-devel; +Cc: alex.zuo, jonathan.cavitt, intel-xe, matthew.brost

Rename xe_vm_fault to drm_xe_vm_fault to better align with uAPI struct
naming conventions.

Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
 drivers/gpu/drm/xe/xe_vm.c | 14 +++++++-------
 include/uapi/drm/xe_drm.h  |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 753a5fc55baa0..22ce6f8dfb783 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -4286,15 +4286,15 @@ static u8 xe_to_user_srcid(u8 srcid)
 static int fill_faults(struct xe_vm *vm,
 		       struct drm_xe_vm_get_property *args)
 {
-	struct xe_vm_fault __user *usr_ptr = u64_to_user_ptr(args->data);
-	struct xe_vm_fault *fault_list, fault_entry = { 0 };
+	struct drm_xe_vm_fault __user *usr_ptr = u64_to_user_ptr(args->data);
+	struct drm_xe_vm_fault *fault_list, fault_entry = { 0 };
 	struct xe_vm_fault_entry *entry;
 	int ret = 0, i = 0, count, entry_size;
 
-	entry_size = sizeof(struct xe_vm_fault);
+	entry_size = sizeof(struct drm_xe_vm_fault);
 	count = args->size / entry_size;
 
-	fault_list = kcalloc(count, sizeof(struct xe_vm_fault), GFP_KERNEL);
+	fault_list = kcalloc(count, sizeof(struct drm_xe_vm_fault), GFP_KERNEL);
 	if (!fault_list)
 		return -ENOMEM;
 
@@ -4332,7 +4332,7 @@ static int xe_vm_get_property_helper(struct xe_vm *vm,
 	switch (args->property) {
 	case DRM_XE_VM_GET_PROPERTY_FAULTS:
 		spin_lock(&vm->faults.lock);
-		size = size_mul(sizeof(struct xe_vm_fault), vm->faults.len);
+		size = size_mul(sizeof(struct drm_xe_vm_fault), vm->faults.len);
 		spin_unlock(&vm->faults.lock);
 
 		if (!args->size) {
@@ -4347,9 +4347,9 @@ static int xe_vm_get_property_helper(struct xe_vm *vm,
 		 * the number of faults in the VM fault array.
 		 *
 		 * We should also at least assert that the args->size value
-		 * is a multiple of the xe_vm_fault struct size.
+		 * is a multiple of the drm_xe_vm_fault struct size.
 		 */
-		if (args->size > size || args->size % sizeof(struct xe_vm_fault))
+		if (args->size > size || args->size % sizeof(struct drm_xe_vm_fault))
 			return -EINVAL;
 
 		return fill_faults(vm, args);
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 8c852abcacf0d..89c0dbe227dd7 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -1271,8 +1271,8 @@ struct drm_xe_vm_bind {
 	__u64 reserved[2];
 };
 
-/** struct xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
-struct xe_vm_fault {
+/** struct drm_xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
+struct drm_xe_vm_fault {
 	/** @address: Canonical address of the fault */
 	__u64 address;
 	/** @address_precision: Precision of faulted address */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault
  2026-09-03 23:16 [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault Jonathan Cavitt
@ 2026-09-03 23:22 ` sashiko-bot
  2026-09-04  0:16 ` Matthew Brost
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-03 23:22 UTC (permalink / raw)
  To: Jonathan Cavitt; +Cc: dri-devel, intel-xe

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Renaming the exported UAPI structure `xe_vm_fault` breaks userspace source compatibility.
--

commit 718d9f0d7813c0d7b1b78dab4ab5c1afd1f3f75a
Author: Jonathan Cavitt <jonathan.cavitt@intel.com>

drm/xe: Rename xe_vm_fault to drm_xe_vm_fault

This commit renames xe_vm_fault to drm_xe_vm_fault to better align with
uAPI struct naming conventions.

[ ... ]

> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 8c852abcacf0d..89c0dbe227dd7 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -1271,8 +1271,8 @@ struct drm_xe_vm_bind {
>  	__u64 reserved[2];
>  };
>  
> -/** struct xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
> -struct xe_vm_fault {
> +/** struct drm_xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
> +struct drm_xe_vm_fault {

[Severity: High]
Does renaming this exported UAPI structure break userspace source
compatibility? 

Userspace applications that rely on struct xe_vm_fault will fail to compile
when updating their kernel headers and attempting to use the old struct
xe_vm_fault name.

Should a backward-compatible alias be provided for the old name?

>  	/** @address: Canonical address of the fault */
>  	__u64 address;
>  	/** @address_precision: Precision of faulted address */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260903231632.399765-1-jonathan.cavitt@intel.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault
  2026-09-03 23:16 [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault Jonathan Cavitt
  2026-09-03 23:22 ` sashiko-bot
@ 2026-09-04  0:16 ` Matthew Brost
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Brost @ 2026-09-04  0:16 UTC (permalink / raw)
  To: Jonathan Cavitt; +Cc: dri-devel, alex.zuo, intel-xe

On Fri, Sep 04, 2026 at 07:16:32AM +0800, Jonathan Cavitt wrote:
> Rename xe_vm_fault to drm_xe_vm_fault to better align with uAPI struct
> naming conventions.
> 
> Suggested-by: Matthew Brost <matthew.brost@intel.com>

Sashiko raised a concern that this could break compilation. I suppose
that's probably correct if, for example, a project is built against
headers installed on a machine. However, I think most projects include
the header directly in the project. Mesa, for example, does this in
`./include/drm-uapi/xe_drm.h`.

So I'd say this is a non-issue. When a project pulls in the new header,
it can fix the compilation changes in tandem.

That said, let's make sure we get an ack from Mesa (which I believe is
the only UAPI user) before merging this change.

With that:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_vm.c | 14 +++++++-------
>  include/uapi/drm/xe_drm.h  |  4 ++--
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 753a5fc55baa0..22ce6f8dfb783 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -4286,15 +4286,15 @@ static u8 xe_to_user_srcid(u8 srcid)
>  static int fill_faults(struct xe_vm *vm,
>  		       struct drm_xe_vm_get_property *args)
>  {
> -	struct xe_vm_fault __user *usr_ptr = u64_to_user_ptr(args->data);
> -	struct xe_vm_fault *fault_list, fault_entry = { 0 };
> +	struct drm_xe_vm_fault __user *usr_ptr = u64_to_user_ptr(args->data);
> +	struct drm_xe_vm_fault *fault_list, fault_entry = { 0 };
>  	struct xe_vm_fault_entry *entry;
>  	int ret = 0, i = 0, count, entry_size;
>  
> -	entry_size = sizeof(struct xe_vm_fault);
> +	entry_size = sizeof(struct drm_xe_vm_fault);
>  	count = args->size / entry_size;
>  
> -	fault_list = kcalloc(count, sizeof(struct xe_vm_fault), GFP_KERNEL);
> +	fault_list = kcalloc(count, sizeof(struct drm_xe_vm_fault), GFP_KERNEL);
>  	if (!fault_list)
>  		return -ENOMEM;
>  
> @@ -4332,7 +4332,7 @@ static int xe_vm_get_property_helper(struct xe_vm *vm,
>  	switch (args->property) {
>  	case DRM_XE_VM_GET_PROPERTY_FAULTS:
>  		spin_lock(&vm->faults.lock);
> -		size = size_mul(sizeof(struct xe_vm_fault), vm->faults.len);
> +		size = size_mul(sizeof(struct drm_xe_vm_fault), vm->faults.len);
>  		spin_unlock(&vm->faults.lock);
>  
>  		if (!args->size) {
> @@ -4347,9 +4347,9 @@ static int xe_vm_get_property_helper(struct xe_vm *vm,
>  		 * the number of faults in the VM fault array.
>  		 *
>  		 * We should also at least assert that the args->size value
> -		 * is a multiple of the xe_vm_fault struct size.
> +		 * is a multiple of the drm_xe_vm_fault struct size.
>  		 */
> -		if (args->size > size || args->size % sizeof(struct xe_vm_fault))
> +		if (args->size > size || args->size % sizeof(struct drm_xe_vm_fault))
>  			return -EINVAL;
>  
>  		return fill_faults(vm, args);
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index 8c852abcacf0d..89c0dbe227dd7 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -1271,8 +1271,8 @@ struct drm_xe_vm_bind {
>  	__u64 reserved[2];
>  };
>  
> -/** struct xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
> -struct xe_vm_fault {
> +/** struct drm_xe_vm_fault - Describes faults for %DRM_XE_VM_GET_PROPERTY_FAULTS */
> +struct drm_xe_vm_fault {
>  	/** @address: Canonical address of the fault */
>  	__u64 address;
>  	/** @address_precision: Precision of faulted address */
> -- 
> 2.53.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-04  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 23:16 [PATCH] drm/xe: Rename xe_vm_fault to drm_xe_vm_fault Jonathan Cavitt
2026-09-03 23:22 ` sashiko-bot
2026-09-04  0:16 ` Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox