From f73b72270539b3870d6c79cfb1015a6d90767446 Mon Sep 17 00:00:00 2001 From: Sooyoung Ha Date: Thu, 16 Jun 2016 14:42:05 +0900 Subject: [PATCH] yagl: introduce yagl protocol version Now yagl driver receives the protocol version from yagl device and send it to user. Change-Id: I156efb5a407bf29ef00460478f246b0621916096 Signed-off-by: Sooyoung Ha --- drivers/gpu/yagl/yagl_driver.c | 7 +++++-- drivers/gpu/yagl/yagl_ioctl.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/yagl/yagl_driver.c b/drivers/gpu/yagl/yagl_driver.c index 3a8f4ad..1af7016 100644 --- a/drivers/gpu/yagl/yagl_driver.c +++ b/drivers/gpu/yagl/yagl_driver.c @@ -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: diff --git a/drivers/gpu/yagl/yagl_ioctl.h b/drivers/gpu/yagl/yagl_ioctl.h index f4f4ab9..9f60985 100644 --- a/drivers/gpu/yagl/yagl_ioctl.h +++ b/drivers/gpu/yagl/yagl_ioctl.h @@ -6,7 +6,7 @@ /* * Version number. */ -#define YAGL_VERSION 24 +#define YAGL_VERSION 1 /* * Device control codes magic. -- 2.7.4