[openchrome-devel] drm-openchrome: Branch 'drm-next-5.20' - 3 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Mon Jul 25 20:58:29 UTC 2022


 drivers/gpu/drm/via/via_drv.c   |   35 +++++++++++++++++++++++------------
 drivers/gpu/drm/via/via_drv.h   |   11 +++++++++--
 drivers/gpu/drm/via/via_ioctl.c |   27 +++++++--------------------
 3 files changed, 39 insertions(+), 34 deletions(-)

New commits:
commit b1857c6d763079ff7eeb3880ebaf04defb7ee7e4
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon Jul 25 11:23:00 2022 -0700

    drm/via: Version bumped to 3.5.7
    
    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 8731e36ec826..59bc358e7a4b 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -50,10 +50,10 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		5
-#define DRIVER_PATCHLEVEL	6
+#define DRIVER_PATCHLEVEL	7
 #define DRIVER_NAME		"via"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome"
-#define DRIVER_DATE		"20220709"
+#define DRIVER_DATE		"20220725"
 #define DRIVER_AUTHOR		"OpenChrome Project"
 
 
commit 4193fa52ac241726e432285912812d4ad0c404e0
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon Jul 25 11:17:07 2022 -0700

    drm/via: Move via_driver_ioctls{} to via_drv.c
    
    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 af8f8db2eea9..c569649cb8b1 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -39,10 +39,10 @@
 
 #include <drm/ttm/ttm_bo_api.h>
 
-#include "via_drv.h"
+#include <uapi/drm/via_drm.h>
 
+#include "via_drv.h"
 
-extern const struct drm_ioctl_desc via_driver_ioctls[];
 
 /*
  * For now, this device driver will be disabled, unless the
@@ -154,6 +154,12 @@ exit:
 	return ret;
 }
 
+static const struct drm_ioctl_desc via_driver_ioctls[] = {
+	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 = {
 	.owner		= THIS_MODULE,
 	.open		= drm_open,
@@ -186,6 +192,7 @@ static struct drm_driver via_driver = {
 				DRIVER_ATOMIC,
 
 	.ioctls = via_driver_ioctls,
+	.num_ioctls = ARRAY_SIZE(via_driver_ioctls),
 
 	.fops = &via_driver_fops,
 };
@@ -301,8 +308,6 @@ static int __init via_init(void)
 		goto exit;
 	}
 
-	via_driver.num_ioctls = via_driver_num_ioctls;
-
 	ret = pci_register_driver(&via_pci_driver);
 
 exit:
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index e5e1fe0cf965..8731e36ec826 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -423,4 +423,11 @@ 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,
+				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 24d72bf4d53a..3c772f73fbc0 100644
--- a/drivers/gpu/drm/via/via_ioctl.c
+++ b/drivers/gpu/drm/via/via_ioctl.c
@@ -25,7 +25,6 @@
  */
 
 #include <drm/drm_gem.h>
-#include <drm/drm_ioctl.h>
 
 #include <drm/ttm/ttm_bo_api.h>
 
@@ -34,9 +33,8 @@
 #include "via_drv.h"
 
 
-static int via_gem_create_ioctl(struct drm_device *dev,
-					void *data,
-					struct drm_file *file_priv)
+int via_gem_create_ioctl(struct drm_device *dev, void *data,
+				struct drm_file *file_priv)
 {
 	struct drm_via_gem_create *args = data;
 	struct ttm_buffer_object *ttm_bo;
@@ -71,9 +69,8 @@ exit:
 	return ret;
 }
 
-static int via_gem_map_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)
 {
 	struct drm_via_gem_map *args = data;
 	struct drm_gem_object *gem;
@@ -96,9 +93,9 @@ exit:
 	return ret;
 }
 
-static int via_gem_unmap_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)
 {
 	struct drm_via_gem_unmap *args = data;
 	int ret;
@@ -110,13 +107,3 @@ static int via_gem_unmap_ioctl(struct drm_device *dev,
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
-
-
-const struct drm_ioctl_desc via_driver_ioctls[] = {
-	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),
-};
-
-
-int via_driver_num_ioctls = ARRAY_SIZE(via_driver_ioctls);
commit 87e282012f2d2bf787d46b1ea7bd3e56dfbe9acc
Author: Kevin Brace <kevinbrace at bracecomputerlab.com>
Date:   Mon Jul 25 10:47:39 2022 -0700

    drm/via: Rearrange via_driver{} member order
    
    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 dcb975439daa..af8f8db2eea9 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -165,23 +165,29 @@ static const struct file_operations via_driver_fops = {
 };
 
 static struct drm_driver via_driver = {
-	.driver_features = DRIVER_GEM |
-				DRIVER_MODESET |
-				DRIVER_ATOMIC,
 	.open = via_driver_open,
 	.postclose = via_driver_postclose,
 	.lastclose = via_driver_lastclose,
+
 	.gem_prime_mmap = drm_gem_prime_mmap,
+
 	.dumb_create = via_driver_dumb_create,
 	.dumb_map_offset = via_driver_dumb_map_offset,
-	.ioctls = via_driver_ioctls,
-	.fops = &via_driver_fops,
-	.name = DRIVER_NAME,
-	.desc = DRIVER_DESC,
-	.date = DRIVER_DATE,
+
 	.major = DRIVER_MAJOR,
 	.minor = DRIVER_MINOR,
 	.patchlevel = DRIVER_PATCHLEVEL,
+	.name = DRIVER_NAME,
+	.desc = DRIVER_DESC,
+	.date = DRIVER_DATE,
+
+	.driver_features = DRIVER_GEM |
+				DRIVER_MODESET |
+				DRIVER_ATOMIC,
+
+	.ioctls = via_driver_ioctls,
+
+	.fops = &via_driver_fops,
 };
 
 static struct pci_device_id via_pci_table[] = {


More information about the openchrome-devel mailing list