[Title] add mutex routine into virtio-gl
authorKitae Kim <kt920.kim@samsung.com>
Sat, 8 Sep 2012 12:33:37 +0000 (21:33 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Sat, 8 Sep 2012 12:35:29 +0000 (21:35 +0900)
[Type] bug fix
[Module] emulator-kernel / opengl
[Priority] Major
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

drivers/char/virtio-gl.c
package/pkginfo.manifest

index 655629f10d196acdce896ecc56fa4fefe8de8f86..b71a2b50dccbc92bc25262ccf5288de0fdcc3c87 100755 (executable)
@@ -22,6 +22,7 @@
 #include <linux/fs.h>\r
 #include <linux/dma-mapping.h>\r
 #include <linux/sched.h>\r
+#include <linux/mutex.h>\r
 #include <linux/slab.h>\r
 #include <linux/miscdevice.h>\r
 #include <linux/virtio.h>\r
@@ -62,6 +63,7 @@ struct virtio_gl_header {
 \r
 static struct virtqueue *vq;\r
 \r
+static DEFINE_MUTEX(gl_mutex);\r
 \r
 /* This is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c with\r
  * some modifications\r
@@ -100,6 +102,8 @@ static int put_data(struct virtio_gl_data *gldata)
        struct virtio_gl_header *header =\r
                                (struct virtio_gl_header *)gldata->buffer;\r
 \r
+       mutex_lock(&gl_mutex);\r
+\r
        ret = header->buf_size;\r
 \r
        o_page = (header->buf_size + PAGE_SIZE-1) >> PAGE_SHIFT;\r
@@ -162,6 +166,7 @@ static int put_data(struct virtio_gl_data *gldata)
 out_free:\r
        kfree(sg_list);\r
 out:\r
+       mutex_unlock(&gl_mutex);\r
        return ret;\r
 }\r
 \r
index dade136a781fecda8002fae445d02150e37fd3e2..57003153104f667304ccdc4d1c641c75f4bccc84 100644 (file)
@@ -1,5 +1,5 @@
 Package: emulator-kernel-x86
-Version: 1.3.15
+Version: 1.3.16
 OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
 Build-host-os: ubuntu-32
 Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com>