[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 9 commits - drivers/gpu/drm include/uapi/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Thu Sep 8 23:42:32 UTC 2022


 drivers/gpu/drm/Makefile        |    2 -
 drivers/gpu/drm/via/Kconfig     |    2 -
 drivers/gpu/drm/via/Makefile    |    2 -
 drivers/gpu/drm/via/via_drv.c   |    5 +--
 drivers/gpu/drm/via/via_drv.h   |   12 +++----
 drivers/gpu/drm/via/via_ioctl.c |   25 +++------------
 include/uapi/drm/via_drm.h      |   66 ++++++++++++++++++++++++++++------------
 7 files changed, 62 insertions(+), 52 deletions(-)

New commits:
commit ded8ec0d2643f48fe857df54a64d22e4aef8ab95
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:54 2022 -0700

    drm/via: Version bumped to 3.6.0
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 4d8ca542575b..282231c467ac 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -49,11 +49,11 @@
 
 
 #define DRIVER_MAJOR		3
-#define DRIVER_MINOR		5
-#define DRIVER_PATCHLEVEL	8
+#define DRIVER_MINOR		6
+#define DRIVER_PATCHLEVEL	0
 #define DRIVER_NAME		"via"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE		"20220728"
+#define DRIVER_DATE		"20220908"
 #define DRIVER_AUTHOR		"OpenChrome Project"
 
 
commit fb3aaee89bf148aefdd72d6c9d7080ea647e6125
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:52 2022 -0700

    drm/via: Change the makefile configuration name back to VIA
    
    Suggested-by: Sam Ravnborg <sam at ravnborg.org>
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 7f76270c2b47..cda36292decd 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -98,7 +98,7 @@ obj-$(CONFIG_DRM_VC4)  += vc4/
 obj-$(CONFIG_DRM_SIS)   += sis/
 obj-$(CONFIG_DRM_SAVAGE)+= savage/
 obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
-obj-$(CONFIG_DRM_OPENCHROME) +=via/
+obj-$(CONFIG_DRM_VIA)	+= via/
 obj-$(CONFIG_DRM_VGEM)	+= vgem/
 obj-$(CONFIG_DRM_VKMS)	+= vkms/
 obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
diff --git a/drivers/gpu/drm/via/Kconfig b/drivers/gpu/drm/via/Kconfig
index 7c4656a1d473..fa6ade047a37 100644
--- a/drivers/gpu/drm/via/Kconfig
+++ b/drivers/gpu/drm/via/Kconfig
@@ -1,4 +1,4 @@
-config DRM_OPENCHROME
+config DRM_VIA
 	tristate "OpenChrome (VIA Technologies Chrome)"
 	depends on DRM && PCI && X86
 	select DRM_KMS_HELPER
diff --git a/drivers/gpu/drm/via/Makefile b/drivers/gpu/drm/via/Makefile
index 73ccacb4cd11..096128c9d910 100644
--- a/drivers/gpu/drm/via/Makefile
+++ b/drivers/gpu/drm/via/Makefile
@@ -23,4 +23,4 @@ via-y := via_crtc.o \
 		via_ttm.o \
 		via_vt1632.o
 
-obj-$(CONFIG_DRM_OPENCHROME)	+= via.o
+obj-$(CONFIG_DRM_VIA)	+= via.o
commit 45213acf1ec9c362f487214da61feb5f8f7a2158
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:50 2022 -0700

    drm/via: Update uAPI header copyright
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 129dfcd28feb..e36c1656f237 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 Kevin Brace
+ * Copyright © 2020-2022 Kevin Brace
  * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
  * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
  *
commit 0a4a5dc1458979fab92a08535b64e96d5bffaf0f
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:47 2022 -0700

    drm/via: Add comments to uAPI IOCTL structs
    
    Suggested-by: Sam Ravnborg <sam at ravnborg.org>
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index a880b154ee74..129dfcd28feb 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -292,18 +292,41 @@ typedef struct drm_via_dmablit {
 /*
  * OpenChrome DRM IOCTL structs
  */
+
+/**
+ * struct drm_via_gem_alloc - IOCTL argument for allocating a GEM based BO
+ * (Buffer Object).
+ */
 struct drm_via_gem_alloc {
+	/* Alignment of the BO. */
 	__u32 alignment;
 	__u32 pad;
+
+	/* Size of the BO. Note that the actual size gets returned from DRM.*/
 	__u64 size;
+
+	/*
+	 * TTM domain of the BO. Note that the actual domain gets returned
+	 * from DRM.
+	 */
 	__u32 domain;
+
+	/* GEM handle to the BO returned from DRM. */
 	__u32 handle;
+
+	/* Offset returned from DRM. */
 	__u64 offset;
 };
 
+/**
+ * struct drm_via_gem_mmap - IOCTL argument for mapping a GEM based BO.
+ */
 struct drm_via_gem_mmap {
+	/* GEM handle of the BO. */
 	__u32 handle;
 	__u32 pad;
+
+	/* Offset returned from DRM. */
 	__u64 offset;
 };
 
commit 38d791fb0c4a9cf0f1f668f6e1a11a5ad71db21e
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:45 2022 -0700

    drm/via: Pad uAPI IOCTL structs to a 64-bit boundary
    
    Suggested-by: Daniel Vetter <daniel at ffwll.ch>
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
    Link: https://blog.ffwll.ch/2013/11/botching-up-ioctls.html

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index f2560cbef029..a880b154ee74 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -294,6 +294,7 @@ typedef struct drm_via_dmablit {
  */
 struct drm_via_gem_alloc {
 	__u32 alignment;
+	__u32 pad;
 	__u64 size;
 	__u32 domain;
 	__u32 handle;
@@ -302,6 +303,7 @@ struct drm_via_gem_alloc {
 
 struct drm_via_gem_mmap {
 	__u32 handle;
+	__u32 pad;
 	__u64 offset;
 };
 
commit 07c3a37aafd4057628640900809ace83ffa2d2b7
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:42 2022 -0700

    drm/via: Convert from uint*_t to __u*
    
    Examples include conversion to __u32 and __u64 types.
    
    Suggested-by: Daniel Vetter <daniel at ffwll.ch>
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>
    Link: https://blog.ffwll.ch/2013/11/botching-up-ioctls.html

diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 1cceba529d9e..f2560cbef029 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -293,16 +293,16 @@ typedef struct drm_via_dmablit {
  * OpenChrome DRM IOCTL structs
  */
 struct drm_via_gem_alloc {
-	uint32_t alignment;
-	uint64_t size;
-	uint32_t domain;
-	uint32_t handle;
-	uint64_t offset;
+	__u32 alignment;
+	__u64 size;
+	__u32 domain;
+	__u32 handle;
+	__u64 offset;
 };
 
 struct drm_via_gem_mmap {
-	uint32_t handle;
-	uint64_t offset;
+	__u32 handle;
+	__u64 offset;
 };
 
 #if defined(__cplusplus)
commit 45fc9f643f5ab3443325a1b405716060c3633e43
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:40 2022 -0700

    drm/via: Rearrange and rename uAPI IOCTL struct members
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 1300ce467fec..1d694d5f04ba 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -87,7 +87,7 @@ int via_gem_mmap_ioctl(struct drm_device *dev, void *data,
 
 	ttm_bo = container_of(gem, struct ttm_buffer_object, base);
 
-	args->map_offset = drm_vma_node_offset_addr(&ttm_bo->base.vma_node);
+	args->offset = drm_vma_node_offset_addr(&ttm_bo->base.vma_node);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 55b69ac025ce..1cceba529d9e 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -293,8 +293,8 @@ typedef struct drm_via_dmablit {
  * OpenChrome DRM IOCTL structs
  */
 struct drm_via_gem_alloc {
-	uint64_t size;
 	uint32_t alignment;
+	uint64_t size;
 	uint32_t domain;
 	uint32_t handle;
 	uint64_t offset;
@@ -302,7 +302,7 @@ struct drm_via_gem_alloc {
 
 struct drm_via_gem_mmap {
 	uint32_t handle;
-	uint64_t map_offset;
+	uint64_t offset;
 };
 
 #if defined(__cplusplus)
commit 7ed42894c8a511538d0ad2c1df4ee1bc06f29032
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:37 2022 -0700

    drm/via: Rename two uAPI IOCTLs to new names
    
    Move them to an address starting from 0x20.
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 3cf72d2f3e61..274df166b394 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -169,8 +169,8 @@ static const struct drm_ioctl_desc via_driver_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(VIA_WAIT_IRQ, drm_invalid_op, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(VIA_DMA_BLIT, drm_invalid_op, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(VIA_BLIT_SYNC, drm_invalid_op, DRM_AUTH),
-	DRM_IOCTL_DEF_DRV(VIA_GEM_CREATE, via_gem_create_ioctl, DRM_AUTH | DRM_UNLOCKED),
-	DRM_IOCTL_DEF_DRV(VIA_GEM_MAP, via_gem_map_ioctl, DRM_AUTH | DRM_UNLOCKED),
+	DRM_IOCTL_DEF_DRV(VIA_GEM_ALLOC, via_gem_alloc_ioctl, DRM_AUTH | DRM_UNLOCKED),
+	DRM_IOCTL_DEF_DRV(VIA_GEM_MMAP, via_gem_mmap_ioctl, DRM_AUTH | DRM_UNLOCKED),
 };
 
 static const struct file_operations via_driver_fops = {
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 5e794544f813..4d8ca542575b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -423,9 +423,9 @@ void via_ext_dvi_init(struct drm_device *dev);
 void via_tmds_init(struct drm_device *dev);
 void via_lvds_init(struct drm_device *dev);
 
-int via_gem_create_ioctl(struct drm_device *dev, void *data,
+int via_gem_alloc_ioctl(struct drm_device *dev, void *data,
 				struct drm_file *file_priv);
-int via_gem_map_ioctl(struct drm_device *dev, void *data,
+int via_gem_mmap_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file_priv);
 
 #endif /* _VIA_DRV_H */
diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 8eba350bffee..1300ce467fec 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -33,10 +33,10 @@
 #include "via_drv.h"
 
 
-int via_gem_create_ioctl(struct drm_device *dev, void *data,
+int via_gem_alloc_ioctl(struct drm_device *dev, void *data,
 				struct drm_file *file_priv)
 {
-	struct drm_via_gem_create *args = data;
+	struct drm_via_gem_alloc *args = data;
 	struct ttm_buffer_object *ttm_bo;
 	struct via_drm_priv *dev_priv = to_via_drm_priv(dev);
 	struct via_bo *bo;
@@ -69,10 +69,10 @@ exit:
 	return ret;
 }
 
-int via_gem_map_ioctl(struct drm_device *dev, void *data,
+int via_gem_mmap_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file_priv)
 {
-	struct drm_via_gem_map *args = data;
+	struct drm_via_gem_mmap *args = data;
 	struct drm_gem_object *gem;
 	struct ttm_buffer_object *ttm_bo;
 	int ret = 0;
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index 5c15fc81c7f3..55b69ac025ce 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -82,8 +82,11 @@ extern "C" {
 #define DRM_VIA_DMA_BLIT        0x0e
 #define DRM_VIA_BLIT_SYNC       0x0f
 
-#define	DRM_VIA_GEM_CREATE	0x10
-#define	DRM_VIA_GEM_MAP		0x11
+/*
+ * OpenChrome DRM IOCTLs
+ */
+#define	DRM_VIA_GEM_ALLOC	0x20
+#define	DRM_VIA_GEM_MMAP	0x21
 
 
 #define DRM_IOCTL_VIA_ALLOCMEM	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
@@ -102,8 +105,11 @@ extern "C" {
 #define DRM_IOCTL_VIA_DMA_BLIT    DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
 #define DRM_IOCTL_VIA_BLIT_SYNC   DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
 
-#define	DRM_IOCTL_VIA_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_CREATE, struct drm_via_gem_create)
-#define	DRM_IOCTL_VIA_GEM_MAP		DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_MAP, struct drm_via_gem_map)
+/*
+ * OpenChrome DRM IOCTLs
+ */
+#define	DRM_IOCTL_VIA_GEM_ALLOC   DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_ALLOC, struct drm_via_gem_alloc)
+#define	DRM_IOCTL_VIA_GEM_MMAP    DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_MMAP, struct drm_via_gem_mmap)
 
 /* Indices into buf.Setup where various bits of state are mirrored per
  * context and per buffer.  These can be fired at the card as a unit,
@@ -283,7 +289,10 @@ typedef struct drm_via_dmablit {
 	drm_via_blitsync_t sync;
 } drm_via_dmablit_t;
 
-struct drm_via_gem_create {
+/*
+ * OpenChrome DRM IOCTL structs
+ */
+struct drm_via_gem_alloc {
 	uint64_t size;
 	uint32_t alignment;
 	uint32_t domain;
@@ -291,7 +300,7 @@ struct drm_via_gem_create {
 	uint64_t offset;
 };
 
-struct drm_via_gem_map {
+struct drm_via_gem_mmap {
 	uint32_t handle;
 	uint64_t map_offset;
 };
commit f2ebc05cb994de749211ed72d0950ead64733336
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Thu Sep 8 16:37:35 2022 -0700

    drm/via: Discontinue DRM_VIA_GEM_UNMAP uAPI IOCTL
    
    Signed-off-by: Kevin Brace <kevinbrace at bracecomputerlab.com>

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 1fa0d624b895..3cf72d2f3e61 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -171,7 +171,6 @@ static const struct drm_ioctl_desc via_driver_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(VIA_BLIT_SYNC, drm_invalid_op, DRM_AUTH),
 	DRM_IOCTL_DEF_DRV(VIA_GEM_CREATE, via_gem_create_ioctl, DRM_AUTH | DRM_UNLOCKED),
 	DRM_IOCTL_DEF_DRV(VIA_GEM_MAP, via_gem_map_ioctl, DRM_AUTH | DRM_UNLOCKED),
-	DRM_IOCTL_DEF_DRV(VIA_GEM_UNMAP, via_gem_unmap_ioctl, DRM_AUTH | DRM_UNLOCKED),
 };
 
 static const struct file_operations via_driver_fops = {
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index baf4f9e4c120..5e794544f813 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -427,7 +427,5 @@ int via_gem_create_ioctl(struct drm_device *dev, void *data,
 				struct drm_file *file_priv);
 int via_gem_map_ioctl(struct drm_device *dev, void *data,
 			struct drm_file *file_priv);
-int via_gem_unmap_ioctl(struct drm_device *dev, void *data,
-			struct drm_file *file_priv);
 
 #endif /* _VIA_DRV_H */
diff --git a/drivers/gpu/drm/via/via_ioctl.c b/drivers/gpu/drm/via/via_ioctl.c
index 3c772f73fbc0..8eba350bffee 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -92,18 +92,3 @@ exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
-
-int via_gem_unmap_ioctl(struct drm_device *dev,
-			void *data,
-			struct drm_file *file_priv)
-{
-	struct drm_via_gem_unmap *args = data;
-	int ret;
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	ret = drm_gem_handle_delete(file_priv, args->handle);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return ret;
-}
diff --git a/include/uapi/drm/via_drm.h b/include/uapi/drm/via_drm.h
index e9da45ce130a..5c15fc81c7f3 100644
--- a/include/uapi/drm/via_drm.h
+++ b/include/uapi/drm/via_drm.h
@@ -84,7 +84,6 @@ extern "C" {
 
 #define	DRM_VIA_GEM_CREATE	0x10
 #define	DRM_VIA_GEM_MAP		0x11
-#define	DRM_VIA_GEM_UNMAP	0x12
 
 
 #define DRM_IOCTL_VIA_ALLOCMEM	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
@@ -105,7 +104,6 @@ extern "C" {
 
 #define	DRM_IOCTL_VIA_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_CREATE, struct drm_via_gem_create)
 #define	DRM_IOCTL_VIA_GEM_MAP		DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_GEM_MAP, struct drm_via_gem_map)
-#define	DRM_IOCTL_VIA_GEM_UNMAP		DRM_IOR(DRM_COMMAND_BASE + DRM_VIA_GEM_UNMAP, struct drm_via_gem_unmap)
 
 /* Indices into buf.Setup where various bits of state are mirrored per
  * context and per buffer.  These can be fired at the card as a unit,
@@ -298,10 +296,6 @@ struct drm_via_gem_map {
 	uint64_t map_offset;
 };
 
-struct drm_via_gem_unmap {
-	uint32_t handle;
-};
-
 #if defined(__cplusplus)
 }
 #endif


More information about the openchrome-devel mailing list