more linux patches

This commit is contained in:
Stephan Raue 2009-05-07 00:56:12 +02:00
parent e915299a1c
commit 5f79e76575
8 changed files with 556 additions and 14 deletions

View File

@ -1,14 +0,0 @@
diff -Naur linux-2.6.29.1.orig/drivers/gpu/drm/i915/i915_dma.c linux-2.6.29.1/drivers/gpu/drm/i915/i915_dma.c
--- linux-2.6.29.1.orig/drivers/gpu/drm/i915/i915_dma.c 2009-04-05 19:44:07.000000000 +0200
+++ linux-2.6.29.1/drivers/gpu/drm/i915/i915_dma.c 2009-04-05 19:45:42.000000000 +0200
@@ -1113,8 +1113,8 @@
/* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
dev_priv->has_gem = 0;
#else
- /* enable GEM by default */
- dev_priv->has_gem = 1;
+ /* disable GEM by default */
+ dev_priv->has_gem = 0;
#endif
dev->driver->get_vblank_counter = i915_get_vblank_counter;

View File

@ -0,0 +1,50 @@
http://lists.freedesktop.org/archives/intel-gfx/2009-February/001313.html
--- a/drivers/gpu/drm/i915/i915_suspend.c.orig 2009-02-18 22:59:19.000000000 -0500
+++ b/drivers/gpu/drm/i915/i915_suspend.c 2009-02-18 22:59:58.000000000 -0500
@@ -28,6 +28,7 @@
#include "drm.h"
#include "i915_drm.h"
#include "i915_drv.h"
+#include <drm/drm_crtc_helper.h>
static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
{
@@ -519,6 +520,8 @@
i915_restore_vga(dev);
+ drm_helper_resume_force_mode(dev);
+
return 0;
}
From f5192bce8be69e5b33d7579bc282fef4d673e2c1 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Sun, 15 Mar 2009 13:55:55 +0100
Subject: [PATCH] Fix i915 nomodeset NULL deref. during PM resume
drm_helper_resume_force_mode() would crash while attempting to
iterate through crtc_list, which is uninitialized when is modesetting
disabled.
---
drivers/gpu/drm/i915/i915_suspend.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index ef5fb6e..b138032 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -520,7 +520,8 @@ int i915_restore_state(struct drm_device *dev)
i915_restore_vga(dev);
- drm_helper_resume_force_mode(dev);
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ drm_helper_resume_force_mode(dev);
return 0;
}
--
1.6.2

View File

@ -0,0 +1,16 @@
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 37427e4..08af9db 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2553,6 +2553,11 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
mutex_lock(&dev->struct_mutex);
+ /* We don't get the flushing right for these chipsets, use the
+ * big hamer for now to avoid random crashiness. */
+ if (IS_I855(dev) || IS_I865G(dev))
+ wbinvd();
+
i915_verify_inactive(dev, __FILE__, __LINE__);
if (dev_priv->mm.wedged) {

View File

@ -0,0 +1,29 @@
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index cc0adb4..9303063 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1108,8 +1108,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
/* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
dev_priv->has_gem = 0;
#else
- /* enable GEM by default */
- dev_priv->has_gem = 1;
+ /* enable GEM by default, except on I8xx */
+ dev_priv->has_gem = !IS_I8XX(dev) ? 1 : 0;
#endif
i915_gem_load(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a70bf77..84664fe 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -750,6 +750,9 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
#define IS_I855(dev) ((dev)->pci_device == 0x3582)
#define IS_I865G(dev) ((dev)->pci_device == 0x2572)
+#define IS_I8XX(dev) (IS_I830(dev) || IS_845G(dev) || IS_I85X(dev) || \
+ IS_I855(dev) || IS_I865G(dev))
+
#define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a)
#define IS_I915GM(dev) ((dev)->pci_device == 0x2592)
#define IS_I945G(dev) ((dev)->pci_device == 0x2772)

View File

@ -0,0 +1,12 @@
diff -Naur linux-2.6.30-rc4.orig/drivers/gpu/drm/i915/i915_dma.c linux-2.6.30-rc4/drivers/gpu/drm/i915/i915_dma.c
--- linux-2.6.30-rc4.orig/drivers/gpu/drm/i915/i915_dma.c 2009-05-06 21:37:41.000000000 +0200
+++ linux-2.6.30-rc4/drivers/gpu/drm/i915/i915_dma.c 2009-05-06 21:39:59.000000000 +0200
@@ -1149,7 +1149,7 @@
dev_priv->has_gem = 0;
#else
/* enable GEM by default, except on I8xx */
- dev_priv->has_gem = !IS_I8XX(dev) ? 1 : 0;
+ dev_priv->has_gem = !IS_I8XX(dev) ? 0 : 0;
#endif
dev->driver->get_vblank_counter = i915_get_vblank_counter;

View File

@ -0,0 +1,77 @@
diff -Naur linux-2.6.29.1/include/linux/dvb/audio.h linux-2.6.29.1a/include/linux/dvb/audio.h
--- linux-2.6.29.1/include/linux/dvb/audio.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/include/linux/dvb/audio.h 2009-04-14 14:13:04.000000000 +0200
@@ -24,7 +24,12 @@
#ifndef _DVBAUDIO_H_
#define _DVBAUDIO_H_
+#ifdef __KERNEL__
#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
typedef enum {
AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
diff -Naur linux-2.6.29.1/include/linux/dvb/dmx.h linux-2.6.29.1a/include/linux/dvb/dmx.h
--- linux-2.6.29.1/include/linux/dvb/dmx.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/include/linux/dvb/dmx.h 2009-04-14 14:13:04.000000000 +0200
@@ -24,7 +24,7 @@
#ifndef _DVBDMX_H_
#define _DVBDMX_H_
-#include <linux/types.h>
+#include <asm/types.h>
#ifdef __KERNEL__
#include <linux/time.h>
#else
diff -Naur linux-2.6.29.1/include/linux/dvb/frontend.h linux-2.6.29.1a/include/linux/dvb/frontend.h
--- linux-2.6.29.1/include/linux/dvb/frontend.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/include/linux/dvb/frontend.h 2009-04-14 14:13:04.000000000 +0200
@@ -26,7 +26,8 @@
#ifndef _DVBFRONTEND_H_
#define _DVBFRONTEND_H_
-#include <linux/types.h>
+#include <asm/types.h>
+
typedef enum fe_type {
FE_QPSK,
diff -Naur linux-2.6.29.1/include/linux/dvb/net.h linux-2.6.29.1a/include/linux/dvb/net.h
--- linux-2.6.29.1/include/linux/dvb/net.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/include/linux/dvb/net.h 2009-04-14 14:13:04.000000000 +0200
@@ -24,7 +24,8 @@
#ifndef _DVBNET_H_
#define _DVBNET_H_
-#include <linux/types.h>
+#include <asm/types.h>
+
struct dvb_net_if {
__u16 pid;
diff -Naur linux-2.6.29.1/include/linux/dvb/video.h linux-2.6.29.1a/include/linux/dvb/video.h
--- linux-2.6.29.1/include/linux/dvb/video.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/include/linux/dvb/video.h 2009-04-14 14:13:04.000000000 +0200
@@ -24,14 +24,17 @@
#ifndef _DVBVIDEO_H_
#define _DVBVIDEO_H_
-#include <linux/types.h>
-#ifdef __KERNEL__
#include <linux/compiler.h>
+
+#ifdef __KERNEL__
+#include <linux/types.h>
#else
+#include <asm/types.h>
#include <stdint.h>
#include <time.h>
#endif
+
typedef enum {
VIDEO_FORMAT_4_3, /* Select 4:3 format */
VIDEO_FORMAT_16_9, /* Select 16:9 format. */

View File

@ -0,0 +1,337 @@
diff -Naur linux-2.6.29.1/drivers/media/dvb/ttpci/av7110_av.c linux-2.6.29.1a/drivers/media/dvb/ttpci/av7110_av.c
--- linux-2.6.29.1/drivers/media/dvb/ttpci/av7110_av.c 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/drivers/media/dvb/ttpci/av7110_av.c 2009-04-14 14:11:04.000000000 +0200
@@ -89,6 +89,11 @@
static void p_to_t(u8 const *buf, long int length, u16 pid,
u8 *counter, struct dvb_demux_feed *feed);
+static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, size_t len);
+static int dvb_video_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *parg);
+static int dvb_audio_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *parg);
int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
@@ -437,6 +442,45 @@
aux_ring_buffer_write(&av7110->aout, buf, count);
}
+
+#define FREE_COND_TS (dvb_ringbuffer_free(rb) >= 4096)
+
+static ssize_t ts_play(struct av7110 *av7110, const char __user *buf,
+ unsigned long count, int nonblock, int type)
+{
+ struct dvb_ringbuffer *rb;
+ u8 *kb;
+ unsigned long todo = count;
+
+ dprintk(2, "%s: type %d cnt %lu\n", __func__, type, count);
+
+ rb = (type) ? &av7110->avout : &av7110->aout;
+ kb = av7110->kbuf[type];
+
+ if (!kb)
+ return -ENOBUFS;
+
+ if (nonblock && !FREE_COND_TS)
+ return -EWOULDBLOCK;
+
+ while (todo >= TS_SIZE) {
+ if (!FREE_COND_TS) {
+ if (nonblock)
+ return count - todo;
+ if (wait_event_interruptible(rb->queue, FREE_COND_TS))
+ return count - todo;
+ }
+ if (copy_from_user(kb, buf, TS_SIZE))
+ return -EFAULT;
+ write_ts_to_decoder(av7110, type, kb, TS_SIZE);
+ todo -= TS_SIZE;
+ buf += TS_SIZE;
+ }
+
+ return count - todo;
+}
+
+
#define FREE_COND (dvb_ringbuffer_free(&av7110->avout) >= 20 * 1024 && \
dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
@@ -780,11 +824,32 @@
}
+static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, size_t len)
+{
+ struct ipack *ipack = &av7110->ipack[type];
+
+ if (!(buf[3] & PAYLOAD))
+ return -1;
+
+ if (buf[1] & PAY_START)
+ av7110_ipack_flush(ipack);
+
+ if (buf[3] & ADAPT_FIELD) {
+ len -= buf[4] + 1;
+ buf += buf[4] + 1;
+ if (!len)
+ return 0;
+ }
+
+ av7110_ipack_instant_repack(buf + 4, len - 4, ipack);
+ return 0;
+}
+
+
int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len)
{
struct dvb_demux *demux = feed->demux;
struct av7110 *av7110 = (struct av7110 *) demux->priv;
- struct ipack *ipack = &av7110->ipack[feed->pes_type];
dprintk(2, "av7110:%p, \n", av7110);
@@ -804,20 +869,7 @@
return -1;
}
- if (!(buf[3] & 0x10)) /* no payload? */
- return -1;
- if (buf[1] & 0x40)
- av7110_ipack_flush(ipack);
-
- if (buf[3] & 0x20) { /* adaptation field? */
- len -= buf[4] + 1;
- buf += buf[4] + 1;
- if (!len)
- return 0;
- }
-
- av7110_ipack_instant_repack(buf + 4, len - 4, &av7110->ipack[feed->pes_type]);
- return 0;
+ return write_ts_to_decoder(av7110, feed->pes_type, buf, len);
}
@@ -916,6 +968,8 @@
{
struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = dvbdev->priv;
+ unsigned char c;
+ ssize_t rc;
dprintk(2, "av7110:%p, \n", av7110);
@@ -925,7 +979,19 @@
if (av7110->videostate.stream_source != VIDEO_SOURCE_MEMORY)
return -EPERM;
- return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
+ if (get_user(c, buf))
+ return -EFAULT;
+ if (c == 0x47 && count % TS_SIZE == 0)
+ rc = ts_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
+ else
+ rc = dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
+
+ if (av7110->video_start_delayed) {
+ av7110->video_start_delayed = false;
+ dvb_video_ioctl(NULL, file, VIDEO_PLAY, NULL);
+ }
+
+ return rc;
}
static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
@@ -952,6 +1018,8 @@
{
struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = dvbdev->priv;
+ unsigned char c;
+ ssize_t rc;
dprintk(2, "av7110:%p, \n", av7110);
@@ -959,7 +1027,20 @@
printk(KERN_ERR "not audio source memory\n");
return -EPERM;
}
- return dvb_aplay(av7110, buf, count, file->f_flags & O_NONBLOCK, 0);
+
+ if (get_user(c, buf))
+ return -EFAULT;
+ if (c == 0x47 && count % TS_SIZE == 0)
+ rc = ts_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 0);
+ else
+ rc = dvb_aplay(av7110, buf, count, file->f_flags & O_NONBLOCK, 0);
+
+ if (av7110->audio_start_delayed) {
+ av7110->audio_start_delayed = false;
+ dvb_audio_ioctl(NULL, file, AUDIO_PLAY, NULL);
+ }
+
+ return rc;
}
static u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00 };
@@ -1044,6 +1125,7 @@
switch (cmd) {
case VIDEO_STOP:
+ av7110->video_start_delayed = false;
av7110->videostate.play_state = VIDEO_STOPPED;
if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)
ret = av7110_av_stop(av7110, RP_VIDEO);
@@ -1055,6 +1137,12 @@
break;
case VIDEO_PLAY:
+ if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) {
+ if (dvb_ringbuffer_empty(&av7110->avout)) {
+ av7110->video_start_delayed = true;
+ break;
+ }
+ }
av7110->trickmode = TRICK_NONE;
if (av7110->videostate.play_state == VIDEO_FREEZED) {
av7110->videostate.play_state = VIDEO_PLAYING;
@@ -1062,7 +1150,6 @@
if (ret)
break;
}
-
if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) {
if (av7110->playing == RP_AV) {
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Stop, 0);
@@ -1079,6 +1166,8 @@
break;
case VIDEO_FREEZE:
+ if (av7110->video_start_delayed)
+ break;
av7110->videostate.play_state = VIDEO_FREEZED;
if (av7110->playing & RP_VIDEO)
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0);
@@ -1089,6 +1178,8 @@
break;
case VIDEO_CONTINUE:
+ if (av7110->video_start_delayed)
+ break;
if (av7110->playing & RP_VIDEO)
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0);
if (!ret)
@@ -1169,6 +1260,8 @@
}
case VIDEO_FAST_FORWARD:
+ if (av7110->video_start_delayed)
+ break;
//note: arg is ignored by firmware
if (av7110->playing & RP_VIDEO)
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
@@ -1182,6 +1275,8 @@
break;
case VIDEO_SLOWMOTION:
+ if (av7110->video_start_delayed)
+ break;
if (av7110->playing&RP_VIDEO) {
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
if (!ret)
@@ -1228,13 +1323,13 @@
break;
case VIDEO_SET_STREAMTYPE:
-
break;
default:
ret = -ENOIOCTLCMD;
break;
}
+
return ret;
}
@@ -1254,6 +1349,7 @@
switch (cmd) {
case AUDIO_STOP:
+ av7110->audio_start_delayed = false;
if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
ret = av7110_av_stop(av7110, RP_AUDIO);
else
@@ -1263,8 +1359,13 @@
break;
case AUDIO_PLAY:
- if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY)
+ if (av7110->audiostate.stream_source == AUDIO_SOURCE_MEMORY) {
+ if (dvb_ringbuffer_avail(&av7110->aout) < 4096) {
+ av7110->audio_start_delayed = true;
+ break;
+ }
ret = av7110_av_start_play(av7110, RP_AUDIO);
+ }
if (!ret)
ret = audcom(av7110, AUDIO_CMD_UNMUTE);
if (!ret)
@@ -1272,12 +1373,16 @@
break;
case AUDIO_PAUSE:
+ if (av7110->audio_start_delayed)
+ break;
ret = audcom(av7110, AUDIO_CMD_MUTE);
if (!ret)
av7110->audiostate.play_state = AUDIO_PAUSED;
break;
case AUDIO_CONTINUE:
+ if (av7110->audio_start_delayed)
+ break;
if (av7110->audiostate.play_state == AUDIO_PAUSED) {
av7110->audiostate.play_state = AUDIO_PLAYING;
ret = audcom(av7110, AUDIO_CMD_UNMUTE | AUDIO_CMD_PCM16);
@@ -1366,9 +1471,10 @@
ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
__Play, 2, AV_PES, 0);
break;
- case AUDIO_SET_ID:
+ case AUDIO_SET_ID:
break;
+
case AUDIO_SET_MIXER:
{
struct audio_mixer *amix = (struct audio_mixer *)parg;
@@ -1376,11 +1482,14 @@
ret = av7110_set_volume(av7110, amix->volume_left, amix->volume_right);
break;
}
+
case AUDIO_SET_STREAMTYPE:
break;
+
default:
ret = -ENOIOCTLCMD;
}
+
return ret;
}
diff -Naur linux-2.6.29.1/drivers/media/dvb/ttpci/av7110.h linux-2.6.29.1a/drivers/media/dvb/ttpci/av7110.h
--- linux-2.6.29.1/drivers/media/dvb/ttpci/av7110.h 2009-04-02 22:55:27.000000000 +0200
+++ linux-2.6.29.1a/drivers/media/dvb/ttpci/av7110.h 2009-04-14 14:11:04.000000000 +0200
@@ -163,6 +163,8 @@
#define RP_VIDEO 1
#define RP_AUDIO 2
#define RP_AV 3
+ bool audio_start_delayed;
+ bool video_start_delayed;
/* OSD */

View File

@ -0,0 +1,35 @@
diff -Naur linux-2.6.29-rc3.orig/sound/usb/usbmixer_maps.c linux-2.6.29-rc3/sound/usb/usbmixer_maps.c
--- linux-2.6.29-rc3.orig/sound/usb/usbmixer_maps.c 2009-01-31 18:44:42.000000000 +0100
+++ linux-2.6.29-rc3/sound/usb/usbmixer_maps.c 2009-01-31 18:53:29.000000000 +0100
@@ -284,6 +284,11 @@
.id = USB_ID(0x041e, 0x3040),
.map = live24ext_map,
},
+ {
+ .id = USB_ID(0x041e, 0x3048),
+ .map = audigy2nx_map,
+ .selector_map = audigy2nx_selectors,
+ },
{
/* Hercules DJ Console (Windows Edition) */
.id = USB_ID(0x06f8, 0xb000),
diff -Naur linux-2.6.29-rc3.orig/sound/usb/usbquirks.h linux-2.6.29-rc3/sound/usb/usbquirks.h
--- linux-2.6.29-rc3.orig/sound/usb/usbquirks.h 2009-01-31 18:44:42.000000000 +0100
+++ linux-2.6.29-rc3/sound/usb/usbquirks.h 2009-01-31 18:54:49.000000000 +0100
@@ -39,6 +39,16 @@
.idProduct = prod, \
.bInterfaceClass = USB_CLASS_VENDOR_SPEC
+/* Creative/Toshiba Multimedia Center SB-0500 */
+{
+ USB_DEVICE(0x041e, 0x3048),
+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+ .vendor_name = "Toshiba",
+ .product_name = "SB-0500",
+ .ifnum = QUIRK_NO_INTERFACE
+ }
+},
+
/* Creative/E-Mu devices */
{
USB_DEVICE(0x041e, 0x3010),