Remove completely unapplied patches
This commit is contained in:
parent
d58808f719
commit
1c43d14db6
|
@ -1,109 +1,34 @@
|
|||
**** Queued for 3.2 ***********************************************************************************
|
||||
**** Other stuff that should go upstream (in decreasing likelyhood) ************
|
||||
|
||||
* acpi-ensure-thermal-limits-match-cpu-freq.patch
|
||||
* revert-efi-rtclock.patch
|
||||
* block-stray-block-put-after-teardown.patch
|
||||
* efi-dont-map-boot-services-on-32bit.patch
|
||||
|
||||
**** Queued for 3.3 ***********************************************************************************
|
||||
drm-edid-try-harder-to-fix-up-broken-headers.patch
|
||||
ext4-Support-check-none-nocheck-mount-options.patch
|
||||
|
||||
**** Other stuff that should go upstream (in decreasing likelyhood) ************************************
|
||||
|
||||
* linux-2.6-acpi-video-dos.patch
|
||||
* linux-2.6-defaults-acpi-video.patch
|
||||
* linux-2.6-defaults-aspm.patch
|
||||
* defaults-acpi-video.patch
|
||||
* disable-i8042-check-on-apple-mac.patch
|
||||
* linux-2.6.30-no-pcspkr-modalias.patch
|
||||
* no-pcspkr-modalias.patch
|
||||
* die-floppy-die.patch
|
||||
Fedora policy decisions
|
||||
Turn into CONFIG_ options and upstream ?
|
||||
|
||||
* linux-2.6-input-kill-stupid-messages.patch
|
||||
* linux-2.6-silence-acpi-blacklist.patch
|
||||
* linux-2.6-silence-fbcon-logo.patch
|
||||
* linux-2.6-silence-noise.patch
|
||||
* input-kill-stupid-messages.patch
|
||||
* silence-acpi-blacklist.patch
|
||||
* silence-fbcon-logo.patch
|
||||
* silence-noise.patch
|
||||
Fedora local 'hush' patches. (TODO: push more upstream)
|
||||
|
||||
* linux-2.6-makefile-after_link.patch
|
||||
* makefile-after_link.patch
|
||||
Rolandware that is used by the debuginfo generation.
|
||||
Possibly upstreamable ?
|
||||
|
||||
* linux-2.6-serial-460800.patch
|
||||
* serial-460800.patch
|
||||
Probably not upstreamable.
|
||||
http://marc.theaimsgroup.com/?l=linux-kernel&m=112687270832687&w=2
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=126403
|
||||
http://lkml.org/lkml/2006/8/2/208
|
||||
|
||||
* linux-2.6-acpi-debug-infinite-loop.patch
|
||||
Responsible: mjg59
|
||||
|
||||
* fix_xen_guest_on_old_EC2.patch
|
||||
Ugly for upstream. It's a hack to make old HV's work optimally.
|
||||
Eventually we can drop it, but probably not until fixed HV's
|
||||
are commonplace. (When?)
|
||||
Responsible: Justin.
|
||||
|
||||
* add-appleir-usb-driver.patch
|
||||
Added September 2009, but had been around even before that.
|
||||
" NACKed upstream with "i'll implement this in the ir framework" or something
|
||||
and never got around to it."
|
||||
Responsible: j-rod
|
||||
|
||||
* dmar-disable-when-ricoh-multifunction.patch
|
||||
Added October 2010
|
||||
|
||||
* linux-2.6-intel-iommu-igfx.patch
|
||||
Invert igfx_off/igfx_on option. Around since forever. Upstreamable ?
|
||||
Mustard ? Config option ?
|
||||
|
||||
* arm-omap-dt-compat.patch
|
||||
* arm-smsc-support-reading-mac-address-from-device-tree.patch
|
||||
reponsible: Dennis
|
||||
|
||||
***********************************************************************************
|
||||
********************************************************************************
|
||||
|
||||
'MUSTARD' patches. Fedora local patches that are very unlikely to go upstream.
|
||||
|
||||
* linux-2.6-32bit-mmap-exec-randomization.patch
|
||||
One half of the remaining exec-shield diff.
|
||||
- davej bugged Ingo again on Jun 17 2011 about upstreaming, no response.
|
||||
- mailed Linus asking for opinions in August 2011. He still hates it.
|
||||
"Ugh. Certainly not in this form. That patch is just disgusting." ..
|
||||
"I think that with NX and now SMEP, if you really care about security,
|
||||
you'd better be using a CPU that supports 64-bit operations anyway."
|
||||
As well as the increased randomisation, there's a key part of this patch
|
||||
that means that DSOs get loaded in the ASCII-Armor area on 32bit.
|
||||
(Addresses have topmost byte == 0)
|
||||
See also https://bugzilla.redhat.com/show_bug.cgi?id=734239
|
||||
|
||||
* linux-2.6-i386-nx-emulation.patch
|
||||
The ugly segment hack part of exec-shield that Linus hates.
|
||||
Unlikely to ever go upstream.
|
||||
|
||||
* linux-2.6-crash-driver.patch
|
||||
* crash-driver.patch
|
||||
Unlikely to go upstream.
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=492803
|
||||
|
||||
* linux-2.6-e1000-ich9-montevina.patch
|
||||
Intel hates it. Davej has an SDV that needs it.
|
||||
Low maintenence, and worth hanging onto until it gets replaced
|
||||
with something that fails in a different way.
|
||||
|
||||
* utrace.patch
|
||||
Hopefully it'll die when uprobes gets upstream.
|
||||
|
||||
|
||||
***********************************************************************************
|
||||
|
||||
Spec file/config todos/cleanups
|
||||
|
||||
* modules-extra: Do a few more things to make it a bit more robust.
|
||||
- Allow for comments in the mod-extra.list file.
|
||||
- Don't fail the build if a module is listed but not built (maybe).
|
||||
- See if it can be tied into Kconfig instead of module names.
|
||||
|
||||
* investigate gzip modules. Everything should support this now?
|
||||
Looks like about 70M savings per kernel installed.
|
||||
|
||||
********************************************************************************
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
|
||||
index 06fe45c..63744cf 100644
|
||||
--- a/drivers/dma/amba-pl08x.c
|
||||
+++ b/drivers/dma/amba-pl08x.c
|
||||
@@ -886,8 +886,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if ((bd.srcbus.addr % bd.srcbus.buswidth) ||
|
||||
- (bd.dstbus.addr % bd.dstbus.buswidth)) {
|
||||
+ if ((((u8)(bd.srcbus.addr & 0xff)) % bd.srcbus.buswidth) ||
|
||||
+ (((u8)(bd.dstbus.addr & 0xff)) % bd.dstbus.buswidth)) {
|
||||
dev_err(&pl08x->adev->dev,
|
||||
"%s src & dst address must be aligned to src"
|
||||
" & dst width if peripheral is flow controller",
|
||||
@@ -908,9 +908,8 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
|
||||
*/
|
||||
if (bd.remainder < mbus->buswidth)
|
||||
early_bytes = bd.remainder;
|
||||
- else if ((mbus->addr) % (mbus->buswidth)) {
|
||||
- early_bytes = mbus->buswidth - (mbus->addr) %
|
||||
- (mbus->buswidth);
|
||||
+ else if ((early_bytes = (u8)(mbus->addr & 0xff) % mbus->buswidth)) {
|
||||
+ early_bytes = mbus->buswidth - early_bytes;
|
||||
if ((bd.remainder - early_bytes) < mbus->buswidth)
|
||||
early_bytes = bd.remainder;
|
||||
}
|
||||
@@ -928,7 +927,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
|
||||
* Master now aligned
|
||||
* - if slave is not then we must set its width down
|
||||
*/
|
||||
- if (sbus->addr % sbus->buswidth) {
|
||||
+ if (((u8)(sbus->addr & 0xff)) % sbus->buswidth) {
|
||||
dev_dbg(&pl08x->adev->dev,
|
||||
"%s set down bus width to one byte\n",
|
||||
__func__);
|
|
@ -2658,7 +2658,6 @@ CONFIG_DRM_I2C_NXP_TDA998X=m
|
|||
CONFIG_DRM_UDL=m
|
||||
CONFIG_DRM_VMWGFX=m
|
||||
CONFIG_DRM_VMWGFX_FBCON=y
|
||||
CONFIG_DRM_VGEM=m
|
||||
CONFIG_DRM_QXL=m
|
||||
|
||||
#
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
Occasionally we see reports of page table corruption, and it's not clear why.
|
||||
By printing out the hardware name, we could potentially see some patterns.
|
||||
|
||||
Signed-off-by: Dave Jones <davej@redhat.com>
|
||||
|
||||
--- linux.orig/include/asm-generic/bug.h
|
||||
+++ linux/include/asm-generic/bug.h
|
||||
@@ -55,6 +55,8 @@ struct bug_entry {
|
||||
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
|
||||
#endif
|
||||
|
||||
+void print_hardware_dmi_name(void);
|
||||
+
|
||||
/*
|
||||
* WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report
|
||||
* significant issues that need prompt attention if they should ever
|
||||
--- linux.orig/kernel/panic.c
|
||||
+++ linux/kernel/panic.c
|
||||
@@ -391,6 +391,15 @@ void oops_exit(void)
|
||||
kmsg_dump(KMSG_DUMP_OOPS);
|
||||
}
|
||||
|
||||
+void print_hardware_dmi_name(void)
|
||||
+{
|
||||
+ const char *board;
|
||||
+
|
||||
+ board = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
+ if (board)
|
||||
+ printk(KERN_WARNING "Hardware name: %s\n", board);
|
||||
+}
|
||||
+
|
||||
#ifdef WANT_WARN_ON_SLOWPATH
|
||||
struct slowpath_args {
|
||||
const char *fmt;
|
||||
@@ -400,13 +409,10 @@ struct slowpath_args {
|
||||
static void warn_slowpath_common(const char *file, int line, void *caller,
|
||||
unsigned taint, struct slowpath_args *args)
|
||||
{
|
||||
- const char *board;
|
||||
-
|
||||
printk(KERN_WARNING "------------[ cut here ]------------\n");
|
||||
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
|
||||
- board = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
- if (board)
|
||||
- printk(KERN_WARNING "Hardware name: %s\n", board);
|
||||
+
|
||||
+ print_hardware_dmi_name();
|
||||
|
||||
if (args)
|
||||
vprintk(args->fmt, args->args);
|
||||
--- linux.orig/mm/memory.c
|
||||
+++ linux/mm/memory.c
|
||||
@@ -706,6 +706,8 @@ static void print_bad_pte(struct vm_area
|
||||
"BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n",
|
||||
current->comm,
|
||||
(long long)pte_val(pte), (long long)pmd_val(*pmd));
|
||||
+ print_hardware_dmi_name();
|
||||
+
|
||||
if (page)
|
||||
dump_page(page);
|
||||
printk(KERN_ALERT
|
||||
--- linux.orig/mm/page_alloc.c
|
||||
+++ linux/mm/page_alloc.c
|
||||
@@ -321,6 +321,7 @@ static void bad_page(struct page *page)
|
||||
current->comm, page_to_pfn(page));
|
||||
dump_page(page);
|
||||
|
||||
+ print_hardware_dmi_name();
|
||||
print_modules();
|
||||
dump_stack();
|
||||
out:
|
|
@ -1,47 +0,0 @@
|
|||
From 115cb7ab7d3b87fe43b1fe9b05ec894b1fcfb5cf Mon Sep 17 00:00:00 2001
|
||||
From: Adam Jackson <ajax@redhat.com>
|
||||
Date: Wed, 7 Dec 2011 18:26:23 -0500
|
||||
Subject: [PATCH] drm/edid: Try harder to fix up broken headers
|
||||
|
||||
There's no reason to force the first byte to be correct if we're already
|
||||
scoring how correct the header is.
|
||||
|
||||
See also: https://bugzilla.redhat.com/show_bug.cgi?id=722909
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_edid.c | 18 ++++++++----------
|
||||
1 files changed, 8 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
|
||||
index 7425e5c..8b16a49 100644
|
||||
--- a/drivers/gpu/drm/drm_edid.c
|
||||
+++ b/drivers/gpu/drm/drm_edid.c
|
||||
@@ -154,16 +154,14 @@ drm_edid_block_valid(u8 *raw_edid)
|
||||
int i;
|
||||
u8 csum = 0;
|
||||
struct edid *edid = (struct edid *)raw_edid;
|
||||
-
|
||||
- if (raw_edid[0] == 0x00) {
|
||||
- int score = drm_edid_header_is_valid(raw_edid);
|
||||
- if (score == 8) ;
|
||||
- else if (score >= 6) {
|
||||
- DRM_DEBUG("Fixing EDID header, your hardware may be failing\n");
|
||||
- memcpy(raw_edid, edid_header, sizeof(edid_header));
|
||||
- } else {
|
||||
- goto bad;
|
||||
- }
|
||||
+ int score = drm_edid_header_is_valid(raw_edid);
|
||||
+
|
||||
+ if (score == 8) ;
|
||||
+ else if (score >= 6) {
|
||||
+ DRM_DEBUG("Fixing EDID header, your hardware may be failing\n");
|
||||
+ memcpy(raw_edid, edid_header, sizeof(edid_header));
|
||||
+ } else {
|
||||
+ goto bad;
|
||||
}
|
||||
|
||||
for (i = 0; i < EDID_LENGTH; i++)
|
||||
--
|
||||
1.7.7.3
|
||||
|
492
drm-vgem.patch
492
drm-vgem.patch
|
@ -1,492 +0,0 @@
|
|||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
|
||||
index 2418429..566c468 100644
|
||||
--- a/drivers/gpu/drm/Kconfig
|
||||
+++ b/drivers/gpu/drm/Kconfig
|
||||
@@ -159,6 +159,14 @@ config DRM_SAVAGE
|
||||
Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister
|
||||
chipset. If M is selected the module will be called savage.
|
||||
|
||||
+config DRM_VGEM
|
||||
+ tristate "Virtual GEM provider"
|
||||
+ depends on DRM
|
||||
+ help
|
||||
+ Choose this option to get a virtual graphics memory manager,
|
||||
+ as used by Mesa's software renderer for enhanced performance.
|
||||
+ If M is selected the module will be called vgem.
|
||||
+
|
||||
source "drivers/gpu/drm/exynos/Kconfig"
|
||||
|
||||
source "drivers/gpu/drm/vmwgfx/Kconfig"
|
||||
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
|
||||
index 0cde1b8..021bf8a 100644
|
||||
--- a/drivers/gpu/drm/Makefile
|
||||
+++ b/drivers/gpu/drm/Makefile
|
||||
@@ -34,6 +34,7 @@ obj-$(CONFIG_DRM_SIS) += sis/
|
||||
obj-$(CONFIG_DRM_SAVAGE)+= savage/
|
||||
obj-$(CONFIG_DRM_VMWGFX)+= vmwgfx/
|
||||
obj-$(CONFIG_DRM_VIA) +=via/
|
||||
+obj-$(CONFIG_DRM_VGEM) += vgem/
|
||||
obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
|
||||
obj-$(CONFIG_DRM_EXYNOS) +=exynos/
|
||||
obj-$(CONFIG_DRM_GMA500) += gma500/
|
||||
diff --git a/drivers/gpu/drm/vgem/Makefile b/drivers/gpu/drm/vgem/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..3f4c7b8
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/vgem/Makefile
|
||||
@@ -0,0 +1,4 @@
|
||||
+ccflags-y := -Iinclude/drm
|
||||
+vgem-y := vgem_drv.o
|
||||
+
|
||||
+obj-$(CONFIG_DRM_VGEM) += vgem.o
|
||||
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
|
||||
new file mode 100644
|
||||
index 0000000..16f88ee
|
||||
--- /dev/null
|
||||
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
|
||||
@@ -0,0 +1,377 @@
|
||||
+/*
|
||||
+ * Copyright 2011 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a
|
||||
+ * copy of this software and associated documentation files (the "Software")
|
||||
+ * to deal in the software without restriction, including without limitation
|
||||
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
+ * license, and/or sell copies of the Software, and to permit persons to whom
|
||||
+ * them Software is furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice (including the next
|
||||
+ * paragraph) shall be included in all copies or substantial portions of the
|
||||
+ * Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTIBILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
|
||||
+ * IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ *
|
||||
+ * Authors:
|
||||
+ * Adam Jackson <ajax@redhat.com>
|
||||
+ */
|
||||
+
|
||||
+/**
|
||||
+ * This is vgem, a (non-hardware-backed) GEM service. This is used by Mesa's
|
||||
+ * software renderer and the X server for efficient buffer sharing.
|
||||
+ */
|
||||
+
|
||||
+#include "drmP.h"
|
||||
+#include "drm.h"
|
||||
+#include "vgem_drm.h"
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/ramfs.h>
|
||||
+#include <linux/shmem_fs.h>
|
||||
+
|
||||
+#define DRIVER_NAME "vgem"
|
||||
+#define DRIVER_DESC "Virtual GEM provider"
|
||||
+#define DRIVER_DATE "20120112"
|
||||
+#define DRIVER_MAJOR 1
|
||||
+#define DRIVER_MINOR 0
|
||||
+
|
||||
+#define to_vgem_bo(x) container_of(x, struct drm_vgem_gem_object, base)
|
||||
+
|
||||
+struct drm_vgem_gem_object {
|
||||
+ struct drm_gem_object base;
|
||||
+ struct page **pages;
|
||||
+};
|
||||
+
|
||||
+static int vgem_load(struct drm_device *dev, unsigned long flags)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int vgem_unload(struct drm_device *dev)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void vgem_preclose(struct drm_device *dev, struct drm_file *file)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static void vgem_lastclose(struct drm_device *dev)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_init_object(struct drm_gem_object *obj)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void vgem_gem_put_pages(struct drm_vgem_gem_object *obj)
|
||||
+{
|
||||
+ int num_pages = obj->base.size / PAGE_SIZE;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < num_pages; i++) {
|
||||
+ page_cache_release(obj->pages[i]);
|
||||
+ }
|
||||
+
|
||||
+ drm_free_large(obj->pages);
|
||||
+ obj->pages = NULL;
|
||||
+}
|
||||
+
|
||||
+static void vgem_gem_free_object(struct drm_gem_object *obj)
|
||||
+{
|
||||
+ struct drm_vgem_gem_object *vgem_obj = to_vgem_bo(obj);
|
||||
+
|
||||
+ if (obj)
|
||||
+ drm_gem_free_mmap_offset(obj);
|
||||
+
|
||||
+ drm_gem_object_release(obj);
|
||||
+
|
||||
+ if (vgem_obj->pages)
|
||||
+ vgem_gem_put_pages(vgem_obj);
|
||||
+
|
||||
+ kfree(vgem_obj);
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_get_pages(struct drm_vgem_gem_object *obj)
|
||||
+{
|
||||
+ struct address_space *mapping;
|
||||
+ gfp_t gfpmask = __GFP_NORETRY | __GFP_NOWARN;
|
||||
+ int num_pages, i, ret = 0;
|
||||
+
|
||||
+ num_pages = obj->base.size / PAGE_SIZE;
|
||||
+
|
||||
+ if (!obj->pages) {
|
||||
+ obj->pages = drm_malloc_ab(num_pages, sizeof(struct page *));
|
||||
+ if (obj->pages == NULL)
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping;
|
||||
+ gfpmask |= mapping_gfp_mask(mapping);
|
||||
+
|
||||
+ if (WARN_ON(mapping == NULL))
|
||||
+ return VM_FAULT_SIGBUS;
|
||||
+
|
||||
+ for (i = 0; i < num_pages; i++) {
|
||||
+ struct page *page;
|
||||
+ page = shmem_read_mapping_page_gfp(mapping, i, gfpmask);
|
||||
+ if (IS_ERR(page)) {
|
||||
+ ret = PTR_ERR(page);
|
||||
+ goto err_out;
|
||||
+ }
|
||||
+ obj->pages[i] = page;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
+err_out:
|
||||
+ while (i--)
|
||||
+ page_cache_release(obj->pages[i]);
|
||||
+ drm_free_large(obj->pages);
|
||||
+ obj->pages = NULL;
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
+{
|
||||
+ struct drm_vgem_gem_object *obj = to_vgem_bo(vma->vm_private_data);
|
||||
+ loff_t num_pages;
|
||||
+ pgoff_t page_offset;
|
||||
+ int ret;
|
||||
+
|
||||
+ /* We don't use vmf->pgoff since that has the fake offset */
|
||||
+ page_offset = ((unsigned long)vmf->virtual_address - vma->vm_start) >>
|
||||
+ PAGE_SHIFT;
|
||||
+
|
||||
+ num_pages = obj->base.size / PAGE_SIZE;
|
||||
+
|
||||
+ if (WARN_ON(page_offset > num_pages))
|
||||
+ return VM_FAULT_SIGBUS;
|
||||
+
|
||||
+ ret = vgem_gem_get_pages(obj);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ ret = vm_insert_page(vma, (unsigned long)vmf->virtual_address,
|
||||
+ obj->pages[page_offset]);
|
||||
+
|
||||
+ /* Pretty dumb handler for now */
|
||||
+ switch (ret) {
|
||||
+ case 0:
|
||||
+ case -ERESTARTSYS:
|
||||
+ case -EINTR:
|
||||
+ return VM_FAULT_NOPAGE;
|
||||
+ default:
|
||||
+ return VM_FAULT_SIGBUS;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const struct vm_operations_struct vgem_gem_vm_ops = {
|
||||
+ .fault = vgem_gem_fault,
|
||||
+ .open = drm_gem_vm_open,
|
||||
+ .close = drm_gem_vm_close,
|
||||
+};
|
||||
+
|
||||
+/* ioctls */
|
||||
+
|
||||
+static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
|
||||
+ struct drm_file *file,
|
||||
+ unsigned int *handle,
|
||||
+ unsigned long size)
|
||||
+{
|
||||
+ struct drm_vgem_gem_object *obj;
|
||||
+ struct drm_gem_object *gem_object;
|
||||
+ int err;
|
||||
+
|
||||
+ size = roundup(size, PAGE_SIZE);
|
||||
+
|
||||
+ obj = kzalloc(sizeof(*obj), GFP_KERNEL);
|
||||
+ if (!obj)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ gem_object = &obj->base;
|
||||
+
|
||||
+ if ((err = drm_gem_object_init(dev, gem_object, size)))
|
||||
+ goto out;
|
||||
+
|
||||
+ if ((err = drm_gem_create_mmap_offset(gem_object)))
|
||||
+ goto mmap_out;
|
||||
+
|
||||
+ if ((err = drm_gem_handle_create(file, gem_object, handle)))
|
||||
+ goto handle_out;
|
||||
+
|
||||
+ drm_gem_object_unreference_unlocked(gem_object);
|
||||
+
|
||||
+ return gem_object;
|
||||
+
|
||||
+handle_out:
|
||||
+ drm_gem_free_mmap_offset(gem_object);
|
||||
+
|
||||
+mmap_out:
|
||||
+ drm_gem_object_release(gem_object);
|
||||
+
|
||||
+out:
|
||||
+ kfree(gem_object);
|
||||
+
|
||||
+ return ERR_PTR(err);
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_create_ioctl(struct drm_device *dev, void *data,
|
||||
+ struct drm_file *file)
|
||||
+{
|
||||
+ struct vgem_gem_create *args = data;
|
||||
+ struct drm_gem_object *gem_object;
|
||||
+
|
||||
+ gem_object = vgem_gem_create(dev, file, &args->handle, args->size);
|
||||
+
|
||||
+ if (IS_ERR(gem_object))
|
||||
+ return PTR_ERR(gem_object);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_mmap_ioctl(struct drm_device *dev, void *data,
|
||||
+ struct drm_file *file)
|
||||
+{
|
||||
+ struct vgem_gem_mmap *args = data;
|
||||
+ struct drm_gem_object *obj;
|
||||
+
|
||||
+ obj = drm_gem_object_lookup(dev, file, args->handle);
|
||||
+ if (!obj)
|
||||
+ return -ENOENT;
|
||||
+
|
||||
+ obj->filp->private_data = obj;
|
||||
+
|
||||
+ BUG_ON(!obj->map_list.map);
|
||||
+
|
||||
+ args->mapped = (uint64_t)obj->map_list.hash.key << PAGE_SHIFT;
|
||||
+
|
||||
+ drm_gem_object_unreference_unlocked(obj);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int vgem_gem_getparam_ioctl(struct drm_device *dev, void *data,
|
||||
+ struct drm_file *file)
|
||||
+{
|
||||
+ struct vgem_gem_getparam *args = data;
|
||||
+ int value=0, ret;
|
||||
+
|
||||
+ switch (args->param) {
|
||||
+ case VGEM_PARAM_IS_VGEM:
|
||||
+ value = 1;
|
||||
+ }
|
||||
+
|
||||
+ ret = copy_to_user(args->value, &value, sizeof(int));
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static struct drm_ioctl_desc vgem_ioctls[] = {
|
||||
+ DRM_IOCTL_DEF_DRV(VGEM_GEM_CREATE, vgem_gem_create_ioctl,
|
||||
+ DRM_UNLOCKED | DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(VGEM_GEM_MMAP, vgem_gem_mmap_ioctl,
|
||||
+ DRM_UNLOCKED | DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(VGEM_GEM_GETPARAM, vgem_gem_getparam_ioctl,
|
||||
+ DRM_UNLOCKED),
|
||||
+};
|
||||
+
|
||||
+static const struct file_operations vgem_driver_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .open = drm_open,
|
||||
+ .mmap = drm_gem_mmap,
|
||||
+ .poll = drm_poll,
|
||||
+ .read = drm_read,
|
||||
+ .unlocked_ioctl = drm_ioctl,
|
||||
+ .release = drm_release,
|
||||
+};
|
||||
+
|
||||
+static struct drm_driver vgem_driver = {
|
||||
+ .driver_features = DRIVER_BUS_PLATFORM | DRIVER_GEM,
|
||||
+ .load = vgem_load,
|
||||
+ .unload = vgem_unload,
|
||||
+ .preclose = vgem_preclose,
|
||||
+ .lastclose = vgem_lastclose,
|
||||
+ .gem_init_object = vgem_gem_init_object,
|
||||
+ .gem_free_object = vgem_gem_free_object,
|
||||
+ .gem_vm_ops = &vgem_gem_vm_ops,
|
||||
+ .ioctls = vgem_ioctls,
|
||||
+ .fops = &vgem_driver_fops,
|
||||
+ .name = DRIVER_NAME,
|
||||
+ .desc = DRIVER_DESC,
|
||||
+ .date = DRIVER_DATE,
|
||||
+ .major = DRIVER_MAJOR,
|
||||
+ .minor = DRIVER_MINOR,
|
||||
+};
|
||||
+
|
||||
+static int vgem_platform_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ vgem_driver.num_ioctls = DRM_ARRAY_SIZE(vgem_ioctls);
|
||||
+
|
||||
+ return drm_platform_init(&vgem_driver, pdev);
|
||||
+}
|
||||
+
|
||||
+static int vgem_platform_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ drm_platform_exit(&vgem_driver, pdev);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver vgem_platform_driver = {
|
||||
+ .probe = vgem_platform_probe,
|
||||
+ .remove = __devexit_p(vgem_platform_remove),
|
||||
+ .driver = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .name = DRIVER_NAME,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static struct platform_device *vgem_device;
|
||||
+
|
||||
+static int __init vgem_init(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ if ((ret = platform_driver_register(&vgem_platform_driver)))
|
||||
+ return ret;
|
||||
+
|
||||
+ vgem_device = platform_device_alloc("vgem", -1);
|
||||
+ if (!vgem_device) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = platform_device_add(vgem_device);
|
||||
+ if (!ret)
|
||||
+ return 0;
|
||||
+
|
||||
+out:
|
||||
+ platform_device_put(vgem_device);
|
||||
+ platform_driver_unregister(&vgem_platform_driver);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void __exit vgem_exit(void)
|
||||
+{
|
||||
+ platform_device_unregister(vgem_device);
|
||||
+ platform_driver_unregister(&vgem_platform_driver);
|
||||
+}
|
||||
+
|
||||
+module_init(vgem_init);
|
||||
+module_exit(vgem_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Red Hat, Inc.");
|
||||
+MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
+MODULE_LICENSE("GPL and additional rights");
|
||||
diff --git a/include/drm/vgem_drm.h b/include/drm/vgem_drm.h
|
||||
new file mode 100644
|
||||
index 0000000..df83503
|
||||
--- /dev/null
|
||||
+++ b/include/drm/vgem_drm.h
|
||||
@@ -0,0 +1,62 @@
|
||||
+/*
|
||||
+ * Copyright 2011 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a
|
||||
+ * copy of this software and associated documentation files (the "Software")
|
||||
+ * to deal in the software without restriction, including without limitation
|
||||
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
+ * license, and/or sell copies of the Software, and to permit persons to whom
|
||||
+ * them Software is furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice (including the next
|
||||
+ * paragraph) shall be included in all copies or substantial portions of the
|
||||
+ * Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTIBILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
|
||||
+ * IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#ifndef VGEM_DRM_H
|
||||
+#define VGEM_DRM_H
|
||||
+
|
||||
+/* Bare API largely ripped off from exynos driver */
|
||||
+
|
||||
+struct vgem_gem_create {
|
||||
+ unsigned int size;
|
||||
+ unsigned int flags;
|
||||
+ unsigned int handle;
|
||||
+};
|
||||
+
|
||||
+struct vgem_gem_mmap {
|
||||
+ unsigned int handle;
|
||||
+ unsigned int size;
|
||||
+ uint64_t mapped;
|
||||
+};
|
||||
+
|
||||
+struct vgem_gem_getparam {
|
||||
+#define VGEM_PARAM_IS_VGEM 1
|
||||
+ unsigned int param;
|
||||
+ unsigned int *value;
|
||||
+};
|
||||
+
|
||||
+#define DRM_VGEM_GEM_CREATE 0x00
|
||||
+#define DRM_VGEM_GEM_MMAP 0x01
|
||||
+#define DRM_VGEM_GEM_GETPARAM 0x02
|
||||
+
|
||||
+#define DRM_IOCTL_VGEM_GEM_CREATE \
|
||||
+ DRM_IOWR(DRM_COMMAND_BASE + DRM_VGEM_GEM_CREATE, \
|
||||
+ struct vgem_gem_create)
|
||||
+
|
||||
+#define DRM_IOCTL_VGEM_GEM_MMAP \
|
||||
+ DRM_IOWR(DRM_COMMAND_BASE + DRM_VGEM_GEM_MMAP, \
|
||||
+ struct vgem_gem_mmap)
|
||||
+
|
||||
+#define DRM_IOCTL_VGEM_GEM_GETPARAM \
|
||||
+ DRM_IOWR(DRM_COMMAND_BASE + DRM_VGEM_GEM_GETPARAM, \
|
||||
+ struct vgem_gem_getparam)
|
||||
+
|
||||
+#endif
|
17
kernel.spec
17
kernel.spec
|
@ -624,11 +624,13 @@ Patch09: upstream-reverts.patch
|
|||
|
||||
# Standalone patches
|
||||
|
||||
#drop with next rebase
|
||||
Patch100: taint-vbox.patch
|
||||
|
||||
#drop with next rebase
|
||||
Patch110: vmbugon-warnon.patch
|
||||
|
||||
#atch200: debug-bad-pte-dmi.patch
|
||||
#drop with next rebase
|
||||
Patch201: debug-bad-pte-modules.patch
|
||||
|
||||
Patch390: defaults-acpi-video.patch
|
||||
|
@ -663,8 +665,6 @@ Patch1003: sysrq-secure-boot.patch
|
|||
# virt + ksm patches
|
||||
|
||||
# DRM
|
||||
#atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch
|
||||
#Patch1800: drm-vgem.patch
|
||||
|
||||
# nouveau + drm fixes
|
||||
# intel drm is all merged upstream
|
||||
|
@ -701,7 +701,6 @@ Patch15000: nowatchdog-on-virt.patch
|
|||
|
||||
# lpae
|
||||
Patch21001: arm-lpae-ax88796.patch
|
||||
Patch21003: arm-dma-amba_pl08x-avoid-64bit-division.patch
|
||||
Patch21004: arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch
|
||||
Patch21005: arm-exynos-mp.patch
|
||||
Patch21006: arm-highbank-for-3.12.patch
|
||||
|
@ -1335,11 +1334,13 @@ ApplyOptionalPatch compile-fixes.patch
|
|||
# revert patches from upstream that conflict or that we get via other means
|
||||
ApplyOptionalPatch upstream-reverts.patch -R
|
||||
|
||||
#drop with next rebase
|
||||
ApplyPatch taint-vbox.patch
|
||||
|
||||
#drop with next rebase
|
||||
ApplyPatch vmbugon-warnon.patch
|
||||
|
||||
#plyPatch debug-bad-pte-dmi.patch
|
||||
#drop with next rebase
|
||||
ApplyPatch debug-bad-pte-modules.patch
|
||||
|
||||
# Architecture patches
|
||||
|
@ -1351,7 +1352,6 @@ ApplyPatch debug-bad-pte-modules.patch
|
|||
# ARM
|
||||
#
|
||||
ApplyPatch arm-lpae-ax88796.patch
|
||||
#ApplyPatch arm-dma-amba_pl08x-avoid-64bit-division.patch
|
||||
ApplyPatch arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch
|
||||
ApplyPatch arm-exynos-mp.patch
|
||||
ApplyPatch arm-highbank-for-3.12.patch
|
||||
|
@ -1439,8 +1439,6 @@ ApplyPatch sysrq-secure-boot.patch
|
|||
# Assorted Virt Fixes
|
||||
|
||||
# DRM core
|
||||
#ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch
|
||||
#ApplyPatch drm-vgem.patch
|
||||
|
||||
# Nouveau DRM
|
||||
|
||||
|
@ -2350,6 +2348,9 @@ fi
|
|||
# ||----w |
|
||||
# || ||
|
||||
%changelog
|
||||
* Thu Oct 24 2013 Josh Boyer <jwboyer@fedoraproject.org>
|
||||
- Remove completely unapplied patches
|
||||
|
||||
* Tue Oct 22 2013 Josh Boyer <jwboyer@fedoraproject.org>
|
||||
- Build virtio drivers as modules (rhbz 1019569)
|
||||
|
||||
|
|
Loading…
Reference in New Issue