[meego-commits] 7963: Changes to devel:kernel/kernel
zlv
no_reply at build.meego.com
Thu Sep 30 09:00:08 UTC 2010
Hi,
I have made the following changes to kernel in project devel:kernel. Please review and accept ASAP.
Thank You,
zlv
[This message was auto-generated]
---
Request #7963:
submit: home:zlv/kernel(r5) -> devel:kernel/kernel
Message:
virtio-gl driver (developed by Ian Molton) for GL acceleration #7764
State: new 2010-09-30T02:00:08 zlv
Comment: None
changes files:
--------------
--- kernel.changes
+++ kernel.changes
@@ -0,0 +1,5 @@
+* Thu Sep 30 2010 Zhiyuan Lv <zhiyuan.lv at intel.com> - 2.6.35.3
+- virtio-gl driver (developed by Ian Molton) for GL acceleration #7764
+* Thu Sep 30 2010 Zhiyuan Lv <zhiyuan.lv at intel.com> - 2.6.35.3
+- enable VIRTIO_PCI built as kernel module for kernel netbook #7740
+
new:
----
linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
spec files:
-----------
--- kernel-ivi.spec
+++ kernel-ivi.spec
@@ -420,6 +420,10 @@
# crashes
Patch713: linux-2.6.35-fatal-signals.patch
+# Add Virtio-mem module for QEMU GL acceleration
+Patch714: linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
+
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -854,6 +858,11 @@
# linux-2.6.35-fatal-signals.patch
%patch713 -p1
+# Add Virtio-mem module for QEMU GL acceleration
+# linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+%patch714 -p1
+
+
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/config-* .
cp %{SOURCE15} .
--- kernel-mrst.spec
+++ kernel-mrst.spec
@@ -421,6 +421,10 @@
# crashes
Patch713: linux-2.6.35-fatal-signals.patch
+# Add Virtio-mem module for QEMU GL acceleration
+Patch714: linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
+
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -855,6 +859,11 @@
# linux-2.6.35-fatal-signals.patch
%patch713 -p1
+# Add Virtio-mem module for QEMU GL acceleration
+# linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+%patch714 -p1
+
+
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/config-* .
cp %{SOURCE15} .
--- kernel-n900.spec
+++ kernel-n900.spec
@@ -420,6 +420,10 @@
# crashes
Patch713: linux-2.6.35-fatal-signals.patch
+# Add Virtio-mem module for QEMU GL acceleration
+Patch714: linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
+
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -854,6 +858,11 @@
# linux-2.6.35-fatal-signals.patch
%patch713 -p1
+# Add Virtio-mem module for QEMU GL acceleration
+# linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+%patch714 -p1
+
+
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/config-* .
cp %{SOURCE15} .
--- kernel-netbook.spec
+++ kernel-netbook.spec
@@ -420,6 +420,10 @@
# crashes
Patch713: linux-2.6.35-fatal-signals.patch
+# Add Virtio-mem module for QEMU GL acceleration
+Patch714: linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
+
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -854,6 +858,11 @@
# linux-2.6.35-fatal-signals.patch
%patch713 -p1
+# Add Virtio-mem module for QEMU GL acceleration
+# linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+%patch714 -p1
+
+
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/config-* .
cp %{SOURCE15} .
--- kernel.spec
+++ kernel.spec
@@ -432,6 +432,10 @@
# crashes
Patch713: linux-2.6.35-fatal-signals.patch
+# Add Virtio-mem module for QEMU GL acceleration
+Patch714: linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
+
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -896,6 +900,11 @@
# linux-2.6.35-fatal-signals.patch
%patch713 -p1
+# Add Virtio-mem module for QEMU GL acceleration
+# linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+%patch714 -p1
+
+
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/config-* .
cp %{SOURCE15} .
other changes:
--------------
++++++ config-netbook
--- config-netbook
+++ config-netbook
@@ -49,8 +49,13 @@
CONFIG_KVM_INTEL=m
# CONFIG_KVM_AMD is not set
# CONFIG_KVM_TRACE is not set
-# CONFIG_VIRTIO_PCI is not set
+CONFIG_VIRTIO_PCI=m
# CONFIG_VIRTIO_BALLOON is not set
+# CONFIG_VIRTIO_BLK is not set
+# CONFIG_VIRTIO_NET is not set
+# CONFIG_VIRTIO_CONSOLE is not set
+# CONFIG_HW_RANDOM_VIRTIO is not set
+CONFIG_VIRTIOGL=m
#
# For VMWARE support
++++++ linux-2.6.35-virtio-for-qemu-gl-acceleration.patch (new)
--- linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+++ linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
+index 30879df..35699a0 100644
+--- a/drivers/gpu/Makefile
++++ b/drivers/gpu/Makefile
+@@ -1 +1 @@
+-obj-y += drm/ vga/ pvr/
++obj-y += drm/ vga/ pvr/ misc/
+diff --git a/drivers/gpu/misc/Kconfig b/drivers/gpu/misc/Kconfig
+new file mode 100644
+index 0000000..50043d3
+--- /dev/null
++++ b/drivers/gpu/misc/Kconfig
+@@ -0,0 +1,8 @@
++config VIRTIOGL
++ tristate "Virtio userspace memory transport"
++ depends on VIRTIO_PCI
++ default n
++ help
++ A Driver to facilitate transferring data from userspace to a
++ hypervisor (eg. qemu)
++
+diff --git a/drivers/gpu/misc/Makefile b/drivers/gpu/misc/Makefile
+new file mode 100644
+index 0000000..d9ab333
+--- /dev/null
++++ b/drivers/gpu/misc/Makefile
+@@ -0,0 +1 @@
++obj-$(CONFIG_VIRTIOGL) += virtio-gl.o
+diff --git a/drivers/gpu/misc/virtio-gl.c b/drivers/gpu/misc/virtio-gl.c
+new file mode 100644
+index 0000000..edf8a91
+--- /dev/null
++++ b/drivers/gpu/misc/virtio-gl.c
+@@ -0,0 +1,324 @@
++/*
++ * Copyright (C) 2010 Intel Corporation
++ *
++ * Author: Ian Molton <ian.molton at collabora.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/fs.h>
++#include <linux/dma-mapping.h>
++#include <linux/sched.h>
++#include <linux/slab.h>
++#include <linux/miscdevice.h>
++#include <linux/virtio.h>
++#include <linux/virtio_ids.h>
++#include <linux/virtio_config.h>
++
++#define DEVICE_NAME "glmem"
++
++/* Define to use debugging checksums on transfers */
++#undef DEBUG_GLIO
++
++struct virtio_gl_data {
++ char *buffer;
++ int pages;
++ unsigned int pid;
++};
++
++struct virtio_gl_header {
++ int pid;
++ int buf_size;
++ int r_buf_size;
++#ifdef DEBUG_GLIO
++ int sum;
++#endif
++ char buffer;
++} __packed;
++
++#define to_virtio_gl_data(a) ((struct virtio_gl_data *)(a)->private_data)
++
++#ifdef DEBUG_GLIO
++#define SIZE_OUT_HEADER (sizeof(int)*4)
++#define SIZE_IN_HEADER (sizeof(int)*2)
++#else
++#define SIZE_OUT_HEADER (sizeof(int)*3)
++#define SIZE_IN_HEADER sizeof(int)
++#endif
++
++static struct virtqueue *vq;
++
++/* This is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c with
++ * some modifications
++ */
++static struct scatterlist *vmalloc_to_sg(unsigned char *virt, int length,
++ int r_length, int *sg_out_elem, int *sg_in_elem)
++{
++ unsigned char *virt_o = virt;
++ struct scatterlist *sglist;
++ struct page *pg;
++ int nr_out_pages = (length+PAGE_SIZE-1)/PAGE_SIZE;
++ int nr_in_pages = (r_length+PAGE_SIZE-1)/PAGE_SIZE;
++ int sg_entries;
++ int i;
++
++ /* unaligned */
++ BUG_ON((ulong)virt & ~PAGE_MASK);
++
++ sg_entries = nr_out_pages + nr_in_pages;
++
++ sglist = kcalloc(sg_entries, sizeof(struct scatterlist), GFP_KERNEL);
++ if (!sglist)
++ return NULL;
++
++ sg_init_table(sglist, sg_entries);
++
++ /* Fill with elements for the data */
++ for (i = 0; i < nr_out_pages; i++) {
++ pg = vmalloc_to_page(virt);
++ if (!pg)
++ goto err;
++
++ sg_set_page(&sglist[i], pg, PAGE_SIZE, 0);
++ virt += PAGE_SIZE;
++ }
++
++ virt = virt_o;
++
++ for (; i < nr_out_pages + nr_in_pages; i++) {
++ pg = vmalloc_to_page(virt);
++ if (!pg)
++ goto err;
++
++ sg_set_page(&sglist[i], pg, PAGE_SIZE, 0);
++ virt += PAGE_SIZE;
++ }
++
++ *sg_out_elem = nr_out_pages;
++ *sg_in_elem = nr_in_pages;
++ return sglist;
++
++err:
++ kfree(sglist);
++ return NULL;
++}
++
++static int put_data(struct virtio_gl_data *gldata)
++{
++ struct scatterlist *sg;
++ unsigned int count;
++ int len, rlen;
++ int sg_out_elem = 0, sg_in_elem = 0;
++ struct virtio_gl_header *header =
++ (struct virtio_gl_header *)gldata->buffer;
++
++ len = header->buf_size;
++ rlen = header->r_buf_size;
++ header->pid = gldata->pid;
++
++ if ((len && rlen) &&
++ (len > gldata->pages * PAGE_SIZE ||
++ rlen > gldata->pages * PAGE_SIZE)) {
++ rlen = 0;
++ }
++
++ if (len > gldata->pages * PAGE_SIZE)
++ len = gldata->pages * PAGE_SIZE;
++
++ if (rlen > gldata->pages * PAGE_SIZE)
++ rlen = gldata->pages * PAGE_SIZE;
++
++ if (!len)
++ len = 12;
++
++ sg = vmalloc_to_sg(gldata->buffer, len, rlen, &sg_out_elem,
++ &sg_in_elem);
++
++ if (!sg)
++ return -EIO;
++
++ /* add_buf wants a token to identify this buffer: we hand it any
++ * non-NULL pointer, since there's only ever one buffer.
++ */
++ if (virtqueue_add_buf(vq, sg, sg_out_elem, sg_in_elem,
++ (void *)1) >= 0) {
++ /* Tell Host to go! */
++ virtqueue_kick(vq);
++ /* Chill out until it's done with the buffer. */
++ while (!virtqueue_get_buf(vq, &count))
++ cpu_relax();
++ }
(185 more lines skipped)
++++++ series
--- series
+++ series
@@ -264,3 +264,7 @@
# turn on "print fatal signals" by default, so that we can debug /sbin/init
# crashes
linux-2.6.35-fatal-signals.patch
+
+# Add Virtio-mem module for QEMU GL acceleration
+linux-2.6.35-virtio-for-qemu-gl-acceleration.patch
+
More information about the MeeGo-commits
mailing list