yagl: introduce yagl protocol version
authorSooyoung Ha <yoosah.ha@samsung.com>
Thu, 16 Jun 2016 05:42:05 +0000 (14:42 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Thu, 16 Jun 2016 07:09:25 +0000 (16:09 +0900)
Now yagl driver receives the protocol version from yagl device and send
it to user.

Change-Id: I156efb5a407bf29ef00460478f246b0621916096
Signed-off-by: Sooyoung Ha <yoosah.ha@samsung.com>
drivers/gpu/yagl/yagl_driver.c
drivers/gpu/yagl/yagl_ioctl.h

index 3a8f4ad..1af7016 100644 (file)
@@ -28,6 +28,8 @@
 #define PCI_VENDOR_ID_YAGL 0x19B1
 #define PCI_DEVICE_ID_YAGL 0x1010
 
+static uint32_t protocol_version = 0;
+
 static struct pci_device_id yagl_pci_table[] =
 {
     {
@@ -259,6 +261,7 @@ static int yagl_misc_open(struct inode *inode, struct file *file)
 
     yfile->render_type = yagl_marshal_get_uint32_t(&buff);
     yfile->gl_version = yagl_marshal_get_uint32_t(&buff);
+    protocol_version = yagl_marshal_get_uint32_t(&buff);
 
     kunmap(yfile->pages[0]);
 
@@ -268,7 +271,7 @@ static int yagl_misc_open(struct inode *inode, struct file *file)
 
     mutex_unlock(&device->mutex);
 
-    print_info("%d opened\n", yfile->index);
+    print_info("(protocol %u) %d opened\n", protocol_version, yfile->index);
 
     return nonseekable_open(inode, file);
 
@@ -660,7 +663,7 @@ static long yagl_misc_ioctl(struct file* file, unsigned int cmd, unsigned long a
 
     switch (cmd) {
     case YAGL_IOC_GET_VERSION:
-        value.uint = YAGL_VERSION;
+        value.uint = protocol_version;
         ret = put_user(value.uint, (unsigned int __user*)arg);
         break;
     case YAGL_IOC_GET_USER_INFO:
index f4f4ab9..9f60985 100644 (file)
@@ -6,7 +6,7 @@
 /*
  * Version number.
  */
-#define YAGL_VERSION 24
+#define YAGL_VERSION 1
 
 /*
  * Device control codes magic.