[Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread yakui_zhao
Hi
the following is the patch set for KMS about CRT/LVDS. I have tested them 
on the
T61 box.
patch 01: add the CRT save/restore for VT switch
patch 02: Sync crt mode_valid/mode_set with intel driver
patch 03: sync CRT hotplug detection with intel driver
patch 04: add the load-detection for CRT
patch 05: sync LVDS save/restore with intel driver(Of course the 
possible_crtcs/clones is
added explicitly).
 

Thanks for the comments.
   Yakui






--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Patch 5/5]: DRM/I915: Sync the LVDS save/restore function with intel driver

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/I915: Sync the LVDS save/restore function with intel driver
From: Zhao Yakui yakui.z...@intel.com

Sync the LVDS save/restore functin with intel driver. At the same time
the possible_crtcs/clones for LVDS is added explicitly.

Signed-off-by: Zhao Yakui yakui.z...@intel.com
---
 drivers/gpu/drm/i915/i915_reg.h   |2 ++
 drivers/gpu/drm/i915/intel_lvds.c |   21 ++---
 2 files changed, 20 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_lvds.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_lvds.c2009-03-03 
17:58:26.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_lvds.c 2009-03-03 18:01:19.0 
+0800
@@ -58,9 +58,17 @@
 static u32 intel_lvds_get_max_backlight(struct drm_device *dev)
 {
struct drm_i915_private *dev_priv = dev-dev_private;
+   u32 value, pm_ctl;
 
-   return ((I915_READ(BLC_PWM_CTL)  BACKLIGHT_MODULATION_FREQ_MASK) 
-   BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
+   pm_ctl = I915_READ(BLC_PWM_CTL);
+
+   if (IS_I965GM(dev) || IS_GM45(dev))
+   value = (pm_ctl  BACKLIGHT_MODULATION_FREQ_MASK2) 
+   BACKLIGHT_MODULATION_FREQ_SHIFT2;
+   else
+   value = ((pm_ctl  BACKLIGHT_MODULATION_FREQ_MASK) 
+   BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
+   return value;
 }
 
 /**
@@ -107,6 +115,9 @@
struct drm_device *dev = connector-dev;
struct drm_i915_private *dev_priv = dev-dev_private;
 
+   if (IS_I965GM(dev) || IS_GM45(dev))
+   dev_priv-saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
+
dev_priv-savePP_ON = I915_READ(PP_ON_DELAYS);
dev_priv-savePP_OFF = I915_READ(PP_OFF_DELAYS);
dev_priv-savePP_CONTROL = I915_READ(PP_CONTROL);
@@ -128,6 +139,9 @@
struct drm_device *dev = connector-dev;
struct drm_i915_private *dev_priv = dev-dev_private;
 
+   if (IS_I965GM(dev) || IS_GM45(dev))
+   I915_WRITE(BLC_PWM_CTL2, dev_priv-saveBLC_PWM_CTL2);
+
I915_WRITE(BLC_PWM_CTL, dev_priv-saveBLC_PWM_CTL);
I915_WRITE(PP_ON_DELAYS, dev_priv-savePP_ON);
I915_WRITE(PP_OFF_DELAYS, dev_priv-savePP_OFF);
@@ -440,7 +454,8 @@
connector-display_info.subpixel_order = SubPixelHorizontalRGB;
connector-interlace_allowed = false;
connector-doublescan_allowed = false;
-
+   encoder-possible_crtcs = (1  1);
+   encoder-possible_clones = (1  INTEL_OUTPUT_LVDS);
 
/*
 * LVDS discovery:
Index: linux-2.6/drivers/gpu/drm/i915/i915_reg.h
===
--- linux-2.6.orig/drivers/gpu/drm/i915/i915_reg.h  2009-03-03 
18:01:04.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/i915_reg.h   2009-03-03 18:01:19.0 
+0800
@@ -815,6 +815,7 @@
 /* Backlight control */
 #define BLC_PWM_CTL0x61254
 #define   BACKLIGHT_MODULATION_FREQ_SHIFT  (17)
+#define   BACKLIGHT_MODULATION_FREQ_SHIFT2 (16)
 #define BLC_PWM_CTL2   0x61250 /* 965+ only */
 #define   BLM_COMBINATION_MODE (1  30)
 /*
@@ -824,6 +825,7 @@
  * The actual value is this field multiplied by two.
  */
 #define   BACKLIGHT_MODULATION_FREQ_MASK   (0x7fff  17)
+#define   BACKLIGHT_MODULATION_FREQ_MASK2  (0x  17)
 #define   BLM_LEGACY_MODE  (1  16)
 /*
  * This is the number of cycles out of the backlight modulation cycle for which



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Patch 3/5]: DRM/I915: Sync crt hotplug detection with intel video driver

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/I915: Sync crt hotplug detection with intel video driver
From: Zhao Yakui yakui.z...@intel.com

Synchronize the function of crt hotplug detection with intel driver

Signed-off-by: Zhao Yakui yakui.z...@intel.com
---
 drivers/gpu/drm/i915/i915_reg.h  |   16 +
 drivers/gpu/drm/i915/intel_crt.c |   47 +++
 2 files changed, 49 insertions(+), 14 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/i915_reg.h
===
--- linux-2.6.orig/drivers/gpu/drm/i915/i915_reg.h  2009-03-03 
17:58:30.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/i915_reg.h   2009-03-03 18:01:04.0 
+0800
@@ -632,6 +632,22 @@
 #define   TV_HOTPLUG_INT_EN(1  18)
 #define   CRT_HOTPLUG_INT_EN   (1  9)
 #define   CRT_HOTPLUG_FORCE_DETECT (1  3)
+#define CRT_HOTPLUG_ACTIVATION_PERIOD_32   (0  8)
+/* must use period 64 on GM45 according to docs */
+#define CRT_HOTPLUG_ACTIVATION_PERIOD_64   (1  8)
+#define CRT_HOTPLUG_DAC_ON_TIME_2M (0  7)
+#define CRT_HOTPLUG_DAC_ON_TIME_4M (1  7)
+#define CRT_HOTPLUG_VOLTAGE_COMPARE_40 (0  5)
+#define CRT_HOTPLUG_VOLTAGE_COMPARE_50 (1  5)
+#define CRT_HOTPLUG_VOLTAGE_COMPARE_60 (2  5)
+#define CRT_HOTPLUG_VOLTAGE_COMPARE_70 (3  5)
+#define CRT_HOTPLUG_VOLTAGE_COMPARE_MASK   (3  5)
+#define CRT_HOTPLUG_DETECT_DELAY_1G(0  4)
+#define CRT_HOTPLUG_DETECT_DELAY_2G(1  4)
+#define CRT_HOTPLUG_DETECT_VOLTAGE_325MV   (0  2)
+#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV   (1  2)
+#define CRT_HOTPLUG_MASK   (0x3fc) /* Bits 9-2 */
+
 
 #define PORT_HOTPLUG_STAT  0x61114
 #define   HDMIB_HOTPLUG_INT_STATUS (1  29)
Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-03-03 
18:00:56.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c  2009-03-03 18:01:04.0 
+0800
@@ -165,20 +165,39 @@
 {
struct drm_device *dev = connector-dev;
struct drm_i915_private *dev_priv = dev-dev_private;
-   u32 temp;
-
-   unsigned long timeout = jiffies + msecs_to_jiffies(1000);
-
-   temp = I915_READ(PORT_HOTPLUG_EN);
-
-   I915_WRITE(PORT_HOTPLUG_EN,
-  temp | CRT_HOTPLUG_FORCE_DETECT | (1  5));
-
-   do {
-   if (!(I915_READ(PORT_HOTPLUG_EN)  CRT_HOTPLUG_FORCE_DETECT))
-   break;
-   msleep(1);
-   } while (time_after(timeout, jiffies));
+   u32 hotplug_en;
+   int i, tries = 0;
+   /*
+* On 4 series desktop, CRT detect sequence need to be done twice
+* to get a reliable result.
+*/
+
+   if (IS_G4X(dev)  !IS_GM45(dev))
+   tries = 2;
+   else
+   tries = 1;
+   hotplug_en = I915_READ(PORT_HOTPLUG_EN);
+   hotplug_en = ~(CRT_HOTPLUG_MASK);
+   hotplug_en |= CRT_HOTPLUG_FORCE_DETECT;
+
+   if (IS_GM45(dev))
+   hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
+
+   hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
+
+   for (i = 0; i  tries ; i++) {
+   unsigned long timeout;
+   /* turn on the FORCE_DETECT */
+   I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
+   timeout = jiffies + msecs_to_jiffies(1000);
+   /* wait for FORCE_DETECT to go off */
+   do {
+   if (!(I915_READ(PORT_HOTPLUG_EN) 
+   CRT_HOTPLUG_FORCE_DETECT))
+   break;
+   msleep(1);
+   } while (time_after(timeout, jiffies));
+   }
 
if ((I915_READ(PORT_HOTPLUG_STAT)  CRT_HOTPLUG_MONITOR_MASK) ==
CRT_HOTPLUG_MONITOR_COLOR)



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Patch 4/5]: DRM/I915: Add the load-detection for crt detect

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/I915: Add the load-detection for crt detect
From: Zhao Yakui yakui.z...@intel.com
 
Add the load-detection for crt detect

Signed-off-by: Zhao Yakui yakui.z...@intel.com
---
 drivers/gpu/drm/i915/intel_crt.c |  136 ++-
 1 file changed, 133 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-03-03 
18:01:04.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c  2009-03-03 18:01:12.0 
+0800
@@ -217,9 +217,120 @@
return intel_ddc_probe(intel_output);
 }
 
+/*
+ * Detects CRT presence by checking for load.
+ *
+ * Requires that the current pipe's DPLL is active.  This will cause flicker
+ * on the CRT, so it should not be used while the display is being used.  Only
+ * color (not monochrome) displays are detected.
+ *
+ * return TRUE if CRT is connected.
+ * return FALSE if CRT is disconnected.
+ */
+static bool intel_crt_detect_load(struct intel_crtc *intel_crtc,
+   struct intel_output *intel_output)
+{
+   struct drm_encoder *encoder = intel_output-enc;
+   struct drm_device *drm_dev = encoder-dev;
+   struct drm_i915_private *dev_priv = drm_dev-dev_private;
+   u32 save_bclrpat, save_vtotal, vtotal, vactive, vsample, vblank,
+   vblank_start, vblank_end, dsl;
+   u8  st00;
+   int bclrpat_reg, pipeconf_reg, pipe_dsl_reg, vtotal_reg,
+   vblank_reg, vsync_reg, pipe;
+   boolpresent;
+
+   pipe = intel_crtc-pipe;
+   if (pipe == 0) {
+   bclrpat_reg = BCLRPAT_A;
+   vtotal_reg = VTOTAL_A;
+   vblank_reg = VBLANK_A;
+   vsync_reg = VSYNC_A;
+   pipeconf_reg = PIPEACONF;
+   pipe_dsl_reg = PIPEADSL;
+   } else {
+   bclrpat_reg = BCLRPAT_B;
+   vtotal_reg = VTOTAL_B;
+   vblank_reg = VBLANK_B;
+   vsync_reg = VSYNC_B;
+   pipeconf_reg = PIPEBCONF;
+   pipe_dsl_reg = PIPEBDSL;
+   }
+   save_bclrpat = I915_READ(bclrpat_reg);
+   save_vtotal = I915_READ(vtotal_reg);
+   vblank = I915_READ(vblank_reg);
+
+   vtotal = ((save_vtotal  16)  0xfff) + 1;
+   vactive = (save_vtotal  0x7ff) + 1;
+
+   vblank_start = (vblank  0xfff) + 1;
+   vblank_end = ((vblank  16)  0xfff) + 1;
+
+   /* Set the border color to purple. */
+   I915_WRITE(bclrpat_reg, 0x500050);
+   if (IS_I9XX(drm_dev)) {
+   u32 pipeconf = I915_READ(pipeconf_reg);
+   I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
+   st00 = I915_READ8(VGA_MSR_WRITE);
+   present = (st00  (1  4)) != 0;
+   I915_WRITE(pipeconf_reg, pipeconf);
+   } else {
+   bool restore_vblank = false;
+   int count, detect;
+   /* If there isn't any border,add some.Yes,this will flicker */
+   if (vblank_start = vactive  vblank_end = vtotal) {
+   u32 vsync = I915_READ(vsync_reg);
+   u32 vsync_start = (vsync  0x) + 1;
+   vblank_start = vsync_start;
+   I915_WRITE(vblank_reg, (vblank_start - 1) |
+   ((vblank_end - 1)  16));
+   restore_vblank = true;
+   }
+   /* sample in the vertical border, setting the larger one */
+   if ((vblank_start - vactive) = (vtotal - vblank_end))
+   vsample = (vblank_start + vactive)  1;
+   else
+   vsample = (vtotal + vblank_end)  1;
+   /* wait for the border to be displayed */
+   while (I915_READ(pipe_dsl_reg) = vactive)
+   ;
+   while ((dsl = I915_READ(pipe_dsl_reg)) = vsample)
+   ;
+   /* watch St00 for entire scanline */
+   detect = 0;
+   count = 0;
+   do {
+   count++;
+   /* read the ST00 VGA status register */
+   st00 = I915_READ8(VGA_MSR_WRITE);
+   if (st00  (1  4))
+   detect++;
+   } while ((I915_READ(pipe_dsl_reg) == dsl));
+   /* restore the vblank if necessary */
+   if (restore_vblank)
+   I915_WRITE(vblank_reg, vblank);
+   /*
+* if more than 3/4 of the scanline detected the monitor, it
+* assumed to be present. This works event on i830, where
+* there isn't any way to force the border color accross the
+* screen
+*/
+   present = detect * 4  count * 3;
+  

[Patch 1/5]: DRM/I915: Add the crt save/restore function for VT switch

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/i915: Add the crt save/restore function for VT switch
From: Zhao Yakui yakui.z...@intel.com

Add the crt save/restore function for VT switch

Signed-off-by: Zhao Yakui yakui.z...@intel.com

---
 drivers/gpu/drm/i915/intel_crt.c |   22 ++
 1 file changed, 22 insertions(+)

Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-03-03 
11:47:39.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c  2009-03-03 18:00:44.0 
+0800
@@ -61,6 +61,26 @@
I915_WRITE(ADPA, temp);
 }
 
+static void intel_crt_save(struct drm_connector *connector)
+{
+   struct drm_device *dev = connector-dev;
+   struct drm_i915_private *dev_priv = dev-dev_private;
+   u32 temp;
+
+   temp = I915_READ(ADPA);
+   dev_priv-saveADPA = temp;
+}
+
+static void intel_crt_restore(struct drm_connector *connector)
+{
+   struct drm_device *dev = connector-dev;
+   struct drm_i915_private *dev_priv = dev-dev_private;
+   u32 temp;
+
+   temp = dev_priv-saveADPA;
+   I915_WRITE(ADPA, temp);
+}
+
 static int intel_crt_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
 {
@@ -225,6 +245,8 @@
 };
 
 static const struct drm_connector_funcs intel_crt_connector_funcs = {
+   .save = intel_crt_save,
+   .restore = intel_crt_restore,
.detect = intel_crt_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = intel_crt_destroy,






--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Patch 2/5]: DRM/I915: Sync mode_valid/mode_set with intel video driver

2009-03-03 Thread yakui_zhao
Subject: Patch DRM/I915: Sync mode_valid/mode_set with intel video driver
From: Zhao Yakui yakui.z...@intel.com

Synchronize the function of mode_valid/mode_set with intel video driver

Signed-off-by: Zhao Yakui yakui.z...@intel.com
---
 drivers/gpu/drm/i915/intel_crt.c |   20 
 1 file changed, 16 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/gpu/drm/i915/intel_crt.c
===
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_crt.c 2009-03-03 
18:00:44.0 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_crt.c  2009-03-03 18:04:29.0 
+0800
@@ -84,11 +84,20 @@
 static int intel_crt_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
 {
+   struct drm_device *drm_dev = connector-dev;
+   int max_clock = 0;
if (mode-flags  DRM_MODE_FLAG_DBLSCAN)
return MODE_NO_DBLESCAN;
 
-   if (mode-clock  40 || mode-clock  25000)
-   return MODE_CLOCK_RANGE;
+   if (mode-clock  25000)
+   return MODE_CLOCK_LOW;
+
+   if (!IS_I9XX(drm_dev))
+   max_clock = 35;
+   else
+   max_clock = 40;
+   if (mode-clock  max_clock)
+   return MODE_CLOCK_HIGH;
 
return MODE_OK;
 }
@@ -133,10 +142,13 @@
if (adjusted_mode-flags  DRM_MODE_FLAG_PVSYNC)
adpa |= ADPA_VSYNC_ACTIVE_HIGH;
 
-   if (intel_crtc-pipe == 0)
+   if (intel_crtc-pipe == 0) {
adpa |= ADPA_PIPE_A_SELECT;
-   else
+   I915_WRITE(BCLRPAT_A, 0);
+   } else {
adpa |= ADPA_PIPE_B_SELECT;
+   I915_WRITE(BCLRPAT_B, 0);
+   }
 
I915_WRITE(ADPA, adpa);
 }



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [PATCH] i915: support page flipping

2009-03-03 Thread Chris Wilson
On Thu, 2009-02-26 at 14:35 -0800, Jesse Barnes wrote:
   + ret = i915_gem_object_pin(obj, 0);
   + if (ret) {
   + DRM_ERROR(failed to pin object for flip\n);
   + ret = -EBUSY;
 
  What's the rationale for changing the reported error here? (And it might
  be helpful to printk the original error value.)
 
 Oh I'm not sure what's going on there; I've changed it to just return the pin
 failure.
 
   +  * Put the object in the GTT domain before the flip,
   +  * since there may be outstanding rendering
   +  */
   + i915_gem_object_set_to_gtt_domain(obj, 0);
 
  Need to check, report and handle errors here. And yes, these do occur in
  the wild for some as of yet unknown reason.
 
 Fixed.  Though Mesa is now flushing before calling the server so it should
 happen less often.

I found the source of the errors - ERESTARTSYS, so presumably we need to
add
  if (ret == -ERESTARTSYS) ret = -EINTR;
handling here (after pining and flushing)?
-ickle


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread Steven J Newbury
On Tue, 2009-03-03 at 17:48 +0800, yakui_zhao wrote:
 Hi
 the following is the patch set for KMS about CRT/LVDS. I have tested them 
 on the
 T61 box.
 patch 01: add the CRT save/restore for VT switch
 patch 02: Sync crt mode_valid/mode_set with intel driver
 patch 03: sync CRT hotplug detection with intel driver
 patch 04: add the load-detection for CRT
 patch 05: sync LVDS save/restore with intel driver(Of course the 
 possible_crtcs/clones is
 added explicitly).
  
 
 Thanks for the comments.
Yakui
 
While you are working on this, any chance you could look at the KMS
S-Video initial detection path? For some reason TV out is detected on
boot despite not being connected. X initialisation triggers detection,
but by then xrandr has decided the screen0 is the TV out, resulting in
panels etc. being placed in the middle of the screen until X is
restarted.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 20129] Large texture object obscuring display with radeon driver in dxx-rebirth

2009-03-03 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=20129





--- Comment #9 from jsado_...@comcast.net  2009-03-03 03:05:47 PST ---
Oops, I made a mistake. I forgot that OGL_DISABLE(TEXTURE_2D) is a macro that
tests an internal variable before executing glDisble(GL_TEXTURE_2D). So, I
fixed the code to look like this instead of whats in my previous comment:

glActiveTexture(GL_TEXTURE1);
glDisable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE2);
glDisable(GL_TEXTURE_2D);
glActiveTexture(GL_TEXTURE0);
OGL_DISABLE(TEXTURE_2D);

And this doesn't fix the problem. So I don't think multitexturing has anything
to do with the problem. Sorry about leading people down the wrong track.

What I will do now is verify that the problem still exists with the latest
version of Mesa from the repository. Then I will attempt to whittle down the
game until I can come up with a simple test case that causes this behavior. I
think this is the best approach I can give. I attempted to understand the
radeon code in Mesa, but I am not familiar with graphics card architecture, and
since I don't have the hardware documentation, I really can't say which part
may be in error.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [TIP,regression,i915] /dev/dri/card0 is no longer present

2009-03-03 Thread Sitsofe Wheeler
On Mon, Mar 02, 2009 at 11:05:58AM -0800, Pallipadi, Venkatesh wrote:
 On Sun, 2009-03-01 at 05:48 -0800, Sitsofe Wheeler wrote:
  On Sun, Mar 01, 2009 at 12:39:48PM +0100, Ingo Molnar wrote:
  
   Thanks, i've reverted the commit for now. Could you please send
   a 'dmesg' from the bootup with the failed driver? By all
   likelyhood an ioremap failure causes a driver failure.
  
  
  See below (drm says it initalized though...):
  
  [0.00] Linux version 2.6.29-rc6-6-g17581ad (@verona) (gcc 
  version 4.2.4) #87 Sun Mar 1 13:42:28 GMT 2009
  [0.00] KERNEL supported cpus:
  [0.00]   Intel GenuineIntel
  [0.00] PAT WC disabled due to known CPU erratum.
 
 Looks like PAT is getting disabled on this platform. Can you send the
 output of /proc/cpuinfo please.

The machine has a stepping of the Celeron M chip in it with PAT errata.
I think it becomes disabled  because it would require a careful code to
ensure that WC was only used in circumstances where the errata would not
matter...

Here's the contents of /proc/cpuinfo:
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 13
model name  : Intel(R) Celeron(R) M processor  900MHz
stepping: 8
cpu MHz : 900.074
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx bts
bogomips: 1800.14
clflush size: 64
power management:

-- 
Sitsofe | http://sucs.org/~sits/

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


DRM API Versioning

2009-03-03 Thread Johnson, Charles F
Is there a description somewhere on how the libdrm/kernel drm versioning works 
??  I've grepped until I'm blue in the face and both for libdrm and kernel drm, 
I just not finding how the API version is specified.  Any hints would be 
appreciated.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com




--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [TIP,regression,i915] /dev/dri/card0 is no longer present

2009-03-03 Thread Eric Anholt
On Mon, 2009-03-02 at 22:34 +0100, Ingo Molnar wrote:
 * Pallipadi, Venkatesh venkatesh.pallip...@intel.com wrote:
 
  On Sun, 2009-03-01 at 05:48 -0800, Sitsofe Wheeler wrote:
   On Sun, Mar 01, 2009 at 12:39:48PM +0100, Ingo Molnar wrote:
   
Thanks, i've reverted the commit for now. Could you please send
a 'dmesg' from the bootup with the failed driver? By all
likelyhood an ioremap failure causes a driver failure.
   
   
   See below (drm says it initalized though...):
   
   [0.00] Linux version 2.6.29-rc6-6-g17581ad (@verona) (gcc 
   version 4.2.4) #87 Sun Mar 1 13:42:28 GMT 2009
   [0.00] KERNEL supported cpus:
   [0.00]   Intel GenuineIntel
   [0.00] PAT WC disabled due to known CPU erratum.
  
  Looks like PAT is getting disabled on this platform. Can you 
  send the output of /proc/cpuinfo please.
 
 Does this mean we failed an ioremap()? We still should not fail 
 a device ioremap _ever_. We should just fall back to UC and be 
 done with it. We may emit a warning if we consider it 
 troublesome, but we should never ever break working drivers 
 really.

Thank you!  This has been plaguing us since 2.6.28, but all I can get
out of people is  no, it's doing the right thing, we can't satisfy your
request because handwavey errata stuff to do with conflicts, can't tell
you off the top of my head.

We want WC ioremap, and we try an MTRR in case PAT is disabled (because
of the errata that makes WC PAT sometimes give non-WC behavior).  Give
us a mapping, whether or not it's really WC.  Failing the mapping is not
OK.

-- 
Eric Anholt
e...@anholt.net eric.anh...@intel.com




signature.asc
Description: This is a digitally signed message part
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Additional DRM Version Info

2009-03-03 Thread Johnson, Charles F
Concerning my earlier email concern DRM versioning,  how does the version in 
the following Xorg.0.log text relate to the DRM version in the kernel and 
libdrm:

Kernel DRM version: 8.0.0
and I can work with versions 5.0.x - 7.x.x
Please update either this 2D driver or your kernel DRM.
Disabling DRI.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com




--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


RE: Additional DRM Version Info

2009-03-03 Thread Zhao, Chunfeng
Hi Charles,
In the kernel driver tree, umg-moorestown-drm-tg, psb_drv.h, it define the 
version info for kernel driver psb.ko:
#define PSB_DRM_DRIVER_DATE 20081216
#define PSB_DRM_DRIVER_MAJOR 8
#define PSB_DRM_DRIVER_MINOR 0
#define PAB_DRM_DRIVER_PATCHLEVEL 0

During driver load, this version info will be loaded and checked against the 
user mode 3D driver psb_dri.so, psb_dri.so should be in sync with psb.ko, and 
both driver is updated from time to time, the versioning will updated if they 
need to be resync up.

Hope this answer your question?

Calvin


From: Johnson, Charles F [mailto:charles.f.john...@intel.com]
Sent: Tuesday, March 03, 2009 11:06 AM
To: dri-devel@lists.sourceforge.net
Subject: Additional DRM Version Info

Concerning my earlier email concern DRM versioning,  how does the version in 
the following Xorg.0.log text relate to the DRM version in the kernel and 
libdrm:

Kernel DRM version: 8.0.0
and I can work with versions 5.0.x - 7.x.x
Please update either this 2D driver or your kernel DRM.
Disabling DRI.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


RE: Additional DRM Version Info

2009-03-03 Thread Zhao, Chunfeng
And the xorg.0.log message is saying that the psb_dri.so is expecting psb.ko to 
be 5.x.x-7.0.0, but it see a psb.ko with version of 8.0.0 was loaded. It means 
that the psb_dri.so is a little bit old.

Calvin


From: Zhao, Chunfeng
Sent: Tuesday, March 03, 2009 11:17 AM
To: Johnson, Charles F; dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

Hi Charles,
In the kernel driver tree, umg-moorestown-drm-tg, psb_drv.h, it define the 
version info for kernel driver psb.ko:
#define PSB_DRM_DRIVER_DATE 20081216
#define PSB_DRM_DRIVER_MAJOR 8
#define PSB_DRM_DRIVER_MINOR 0
#define PAB_DRM_DRIVER_PATCHLEVEL 0

During driver load, this version info will be loaded and checked against the 
user mode 3D driver psb_dri.so, psb_dri.so should be in sync with psb.ko, and 
both driver is updated from time to time, the versioning will updated if they 
need to be resync up.

Hope this answer your question?

Calvin


From: Johnson, Charles F [mailto:charles.f.john...@intel.com]
Sent: Tuesday, March 03, 2009 11:06 AM
To: dri-devel@lists.sourceforge.net
Subject: Additional DRM Version Info

Concerning my earlier email concern DRM versioning,  how does the version in 
the following Xorg.0.log text relate to the DRM version in the kernel and 
libdrm:

Kernel DRM version: 8.0.0
and I can work with versions 5.0.x - 7.x.x
Please update either this 2D driver or your kernel DRM.
Disabling DRI.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm: Return EINVAL on duplicate objects in execbuffer object list

2009-03-03 Thread krh
From: Kristian Høgsberg k...@redhat.com

If userspace passes an object list with the same object appearing more
than once, we end up hitting the BUG_ON() in
i915_gem_object_set_to_gpu_domain() as it gets called a second time
for the same object.

Signed-off-by: Kristian Høgsberg k...@redhat.com
---
 drivers/gpu/drm/i915/i915_drv.h |6 ++
 drivers/gpu/drm/i915/i915_gem.c |   17 -
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 17fa408..9186d43 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -457,6 +457,12 @@ struct drm_i915_gem_object {
 
/** for phy allocated objects */
struct drm_i915_gem_phys_object *phys_obj;
+
+   /**
+* Used for checking the object doesn't appear more than once
+* in an execbuffer object list.
+*/
+   int in_execbuffer;
 };
 
 /**
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f105959..237497e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2466,6 +2466,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
struct drm_i915_gem_exec_object *exec_list = NULL;
struct drm_gem_object **object_list = NULL;
struct drm_gem_object *batch_obj;
+   struct drm_i915_gem_object *obj_priv;
int ret, i, pinned = 0;
uint64_t exec_offset;
uint32_t seqno, flush_domains;
@@ -2530,6 +2531,15 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
ret = -EBADF;
goto err;
}
+
+   obj_priv = object_list[i]-driver_private;
+   if (obj_priv-in_execbuffer) {
+   DRM_ERROR(Object %p appears more than once in object 
list\n,
+  object_list[i]);
+   ret = -EBADF;
+   goto err;
+   }
+   obj_priv-in_execbuffer = true;
}
 
/* Pin and relocate */
@@ -2671,8 +2681,13 @@ err:
for (i = 0; i  pinned; i++)
i915_gem_object_unpin(object_list[i]);
 
-   for (i = 0; i  args-buffer_count; i++)
+   for (i = 0; i  args-buffer_count; i++) {
+   if (object_list[i]) {
+   obj_priv = object_list[i]-driver_private;
+   obj_priv-in_execbuffer = false;
+   }
drm_gem_object_unreference(object_list[i]);
+   }
 
mutex_unlock(dev-struct_mutex);
 
-- 
1.6.1.3


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 20246] [852GM/855GM] Crash due to assertion failure

2009-03-03 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=20246


Eric Anholt e...@anholt.net changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #5 from Eric Anholt e...@anholt.net  2009-03-03 12:03:02 PST ---
commit 46e9274e8538e5b0517f611dca99dde611f4e95d
Author: Eric Anholt e...@anholt.net
Date:   Fri Aug 8 13:13:46 2008 -0700

Replace the check_aperture API with one we can make thread-safe.

While the bufmgr isn't thread-safe at the moment, we need it to be for
share
objects between contexts.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 09/10] drm, via: drop Linux 2.6.20 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_bo.c  |   13 -
 linux-core/drm_objects.h |4 
 linux-core/via_dmablit.c |   12 
 3 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 6f083f5..f43480c 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -481,20 +481,11 @@ static void drm_bo_delayed_delete(struct drm_device *dev, 
int remove_all)
}
 }
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-static void drm_bo_delayed_workqueue(void *data)
-#else
 static void drm_bo_delayed_workqueue(struct work_struct *work)
-#endif
 {
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-   struct drm_device *dev = (struct drm_device *) data;
-   struct drm_buffer_manager *bm = dev-bm;
-#else
struct drm_buffer_manager *bm =
container_of(work, struct drm_buffer_manager, wq.work);
struct drm_device *dev = container_of(bm, struct drm_device, bm);
-#endif
 
DRM_DEBUG(Delayed delete Worker\n);
 
@@ -2356,11 +2347,7 @@ int drm_bo_driver_init(struct drm_device *dev)
if (ret)
goto out_unlock;
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-   INIT_WORK(bm-wq, drm_bo_delayed_workqueue, dev);
-#else
INIT_DELAYED_WORK(bm-wq, drm_bo_delayed_workqueue);
-#endif
bm-initialized = 1;
bm-nice_mode = 1;
atomic_set(bm-count, 0);
diff --git a/linux-core/drm_objects.h b/linux-core/drm_objects.h
index 2f49bcf..136fdc8 100644
--- a/linux-core/drm_objects.h
+++ b/linux-core/drm_objects.h
@@ -563,11 +563,7 @@ struct drm_buffer_manager {
struct drm_mem_type_manager man[DRM_BO_MEM_TYPES];
struct list_head unfenced;
struct list_head ddestroy;
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-   struct work_struct wq;
-#else
struct delayed_work wq;
-#endif
uint32_t fence_type;
unsigned long cur_pages;
atomic_t count;
diff --git a/linux-core/via_dmablit.c b/linux-core/via_dmablit.c
index b5f9f05..59e1e11 100644
--- a/linux-core/via_dmablit.c
+++ b/linux-core/via_dmablit.c
@@ -500,17 +500,9 @@ via_dmablit_timer(unsigned long data)
 
 
 static void
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-via_dmablit_workqueue(void *data)
-#else
 via_dmablit_workqueue(struct work_struct *work)
-#endif
 {
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-   drm_via_blitq_t *blitq = (drm_via_blitq_t *) data;
-#else
drm_via_blitq_t *blitq = container_of(work, drm_via_blitq_t, wq);
-#endif
struct drm_device *dev = blitq-dev;
unsigned long irqsave;
drm_via_sg_info_t *cur_sg;
@@ -579,11 +571,7 @@ via_init_dmablit(struct drm_device *dev)
DRM_INIT_WAITQUEUE(blitq-blit_queue + j);
}
DRM_INIT_WAITQUEUE(blitq-busy_queue);
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
-   INIT_WORK(blitq-wq, via_dmablit_workqueue, blitq);
-#else
INIT_WORK(blitq-wq, via_dmablit_workqueue);
-#endif
init_timer(blitq-poll_timer);
blitq-poll_timer.function = via_dmablit_timer;
blitq-poll_timer.data = (unsigned long) blitq;
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 03/10] drm: drop Linux 2.6.10 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_compat.h  |   21 -
 linux-core/mga_drv.c |2 +-
 linux-core/nouveau_drv.c |2 +-
 linux-core/r128_drv.c|2 +-
 linux-core/radeon_drv.c  |2 +-
 linux-core/xgi_drv.c |2 +-
 6 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index a567356..937908a 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -107,27 +107,6 @@
 #define IRQF_SHARED SA_SHIRQ
 #endif
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,10)
-static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long 
from, unsigned long pfn, unsigned long size, pgprot_t pgprot)
-{
-  return remap_page_range(vma, from,
- pfn  PAGE_SHIFT,
- size,
- pgprot);
-}
-
-static __inline__ void *kcalloc(size_t nmemb, size_t size, int flags)
-{
-   void *addr;
-
-   addr = kmalloc(size * nmemb, flags);
-   if (addr != NULL)
-   memset((void *)addr, 0, size * nmemb);
-
-   return addr;
-}
-#endif
-
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,16)
 #define mutex_lock down
 #define mutex_unlock up
diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c
index 14a0be4..ce49857 100644
--- a/linux-core/mga_drv.c
+++ b/linux-core/mga_drv.c
@@ -73,7 +73,7 @@ static struct drm_driver driver = {
.mmap = drm_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
-#if defined(CONFIG_COMPAT)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,9)
+#if defined(CONFIG_COMPAT)
.compat_ioctl = mga_compat_ioctl,
 #endif
},
diff --git a/linux-core/nouveau_drv.c b/linux-core/nouveau_drv.c
index c8f57df..b31485a 100644
--- a/linux-core/nouveau_drv.c
+++ b/linux-core/nouveau_drv.c
@@ -70,7 +70,7 @@ static struct drm_driver driver = {
.mmap = drm_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
-#if defined(CONFIG_COMPAT)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,9)
+#if defined(CONFIG_COMPAT)
.compat_ioctl = nouveau_compat_ioctl,
 #endif
},
diff --git a/linux-core/r128_drv.c b/linux-core/r128_drv.c
index 7b6159b..111fe71 100644
--- a/linux-core/r128_drv.c
+++ b/linux-core/r128_drv.c
@@ -68,7 +68,7 @@ static struct drm_driver driver = {
.mmap = drm_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
-#if defined(CONFIG_COMPAT)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,9)
+#if defined(CONFIG_COMPAT)
.compat_ioctl = r128_compat_ioctl,
 #endif
},
diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c
index 934fa0b..902bdc2 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -114,7 +114,7 @@ static struct drm_driver driver = {
.mmap = drm_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
-#if defined(CONFIG_COMPAT)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,9)
+#if defined(CONFIG_COMPAT)
.compat_ioctl = radeon_compat_ioctl,
 #endif
},
diff --git a/linux-core/xgi_drv.c b/linux-core/xgi_drv.c
index bfe9acd..51ace0f 100644
--- a/linux-core/xgi_drv.c
+++ b/linux-core/xgi_drv.c
@@ -93,7 +93,7 @@ static struct drm_driver driver = {
.mmap = drm_mmap,
.poll = drm_poll,
.fasync = drm_fasync,
-#if defined(CONFIG_COMPAT)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,9)
+#if defined(CONFIG_COMPAT)
.compat_ioctl = xgi_compat_ioctl,
 #endif
},
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 01/10] drm: drm_bo_mmap_locked() is static.

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_vm.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index d4d97a4..6de6031 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -870,8 +870,7 @@ static struct vm_operations_struct drm_bo_vm_ops = {
  * \param map The buffer object drm map.
  * \return zero on success or a negative number on failure.
  */
-
-int drm_bo_mmap_locked(struct vm_area_struct *vma,
+static int drm_bo_mmap_locked(struct vm_area_struct *vma,
   struct file *filp,
   drm_local_map_t *map)
 {
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 07/10] drm: drop Linux 2.6.18 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_compat.c |   45 -
 linux-core/drm_compat.h |   11 ---
 2 files changed, 0 insertions(+), 56 deletions(-)

diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index e90338f..ff4085d 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -583,51 +583,6 @@ EXPORT_SYMBOL(idr_remove_all);
 #endif /* DRM_IDR_COMPAT_FN */
 
 
-
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,18))
-/**
- * idr_replace - replace pointer for given id
- * @idp: idr handle
- * @ptr: pointer you want associated with the id
- * @id: lookup key
- *
- * Replace the pointer registered with an id and return the old value.
- * A -ENOENT return indicates that @id was not found.
- * A -EINVAL return indicates that @id was not within valid constraints.
- *
- * The caller must serialize vs idr_find(), idr_get_new(), and idr_remove().
- */
-void *idr_replace(struct idr *idp, void *ptr, int id)
-{
-   int n;
-   struct idr_layer *p, *old_p;
-
-   n = idp-layers * IDR_BITS;
-   p = idp-top;
-
-   id = MAX_ID_MASK;
-
-   if (id = (1  n))
-   return ERR_PTR(-EINVAL);
-
-   n -= IDR_BITS;
-   while ((n  0)  p) {
-   p = p-ary[(id  n)  IDR_MASK];
-   n -= IDR_BITS;
-   }
-
-   n = id  IDR_MASK;
-   if (unlikely(p == NULL || !test_bit(n, p-bitmap)))
-   return ERR_PTR(-ENOENT);
-
-   old_p = p-ary[n];
-   p-ary[n] = ptr;
-
-   return (void *)old_p;
-}
-EXPORT_SYMBOL(idr_replace);
-#endif
-
 #ifdef DRM_FULL_MM_COMPAT
 #ifdef DRM_NO_FAULT
 unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma,
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index 7763da3..61a6d3d 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -125,12 +125,6 @@
 }
 #endif
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,18)
-#define vmalloc_user(_size) ({void * tmp = vmalloc(_size);   \
-  if (tmp) memset(tmp, 0, size);\
-  (tmp);})
-#endif
-
 #ifndef list_for_each_entry_safe_reverse
 #define list_for_each_entry_safe_reverse(pos, n, head, member)  \
 for (pos = list_entry((head)-prev, typeof(*pos), member),  \
@@ -275,11 +269,6 @@ int idr_for_each(struct idr *idp,
 void idr_remove_all(struct idr *idp);
 #endif
 
-
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,18))
-void *idr_replace(struct idr *idp, void *ptr, int id);
-#endif
-
 #if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,19))
 typedef _Bool   bool;
 #endif
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 05/10] drm: drop Linux 2.6.15 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_bo.c |7 ---
 linux-core/drm_compat.c |  104 +--
 linux-core/drm_compat.h |   24 +--
 linux-core/drm_drv.c|3 -
 linux-core/drm_ttm.c|6 ---
 5 files changed, 2 insertions(+), 142 deletions(-)

diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 88b2ee6..3fb43fc 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -2362,9 +2362,6 @@ int drm_bo_driver_finish(struct drm_device *dev)
if (list_empty(bm-unfenced))
DRM_DEBUG(Unfenced list was clean\n);
 
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15))
-   ClearPageReserved(bm-dummy_read_page);
-#endif
__free_page(bm-dummy_read_page);
 
 out:
@@ -2397,10 +2394,6 @@ int drm_bo_driver_init(struct drm_device *dev)
goto out_unlock;
}
 
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15))
-   SetPageReserved(bm-dummy_read_page);
-#endif
-
/*
 * Initialize the system memory buffer type.
 * Other types need to be driver / IOCTL initialized.
diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index 67baac5..e90338f 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -27,32 +27,6 @@
 
 #include drmP.h
 
-#if defined(CONFIG_X86)  (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15))
-
-/*
- * These have bad performance in the AGP module for the indicated kernel 
versions.
- */
-
-int drm_map_page_into_agp(struct page *page)
-{
-int i;
-i = change_page_attr(page, 1, PAGE_KERNEL_NOCACHE);
-/* Caller's responsibility to call global_flush_tlb() for
- * performance reasons */
-return i;
-}
-
-int drm_unmap_page_from_agp(struct page *page)
-{
-int i;
-i = change_page_attr(page, 1, PAGE_KERNEL);
-/* Caller's responsibility to call global_flush_tlb() for
- * performance reasons */
-return i;
-}
-#endif
-
-
 #if  (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,19))
 
 /*
@@ -76,84 +50,8 @@ pgprot_t vm_get_page_prot(unsigned long vm_flags)
 #endif
 
 
-#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15))
-
-/*
- * vm code for kernels below 2.6.15 in which version a major vm write
- * occured. This implement a simple straightforward
- * version similar to what's going to be
- * in kernel 2.6.19+
- * Kernels below 2.6.15 use nopage whereas 2.6.19 and upwards use
- * nopfn.
- */
-
-static struct {
-   spinlock_t lock;
-   struct page *dummy_page;
-   atomic_t present;
-} drm_np_retry =
-{SPIN_LOCK_UNLOCKED, NOPAGE_OOM, ATOMIC_INIT(0)};
-
-
-static struct page *drm_bo_vm_fault(struct vm_area_struct *vma,
-   struct fault_data *data);
-
-
-struct page * get_nopage_retry(void)
-{
-   if (atomic_read(drm_np_retry.present) == 0) {
-   struct page *page = alloc_page(GFP_KERNEL);
-   if (!page)
-   return NOPAGE_OOM;
-   spin_lock(drm_np_retry.lock);
-   drm_np_retry.dummy_page = page;
-   atomic_set(drm_np_retry.present,1);
-   spin_unlock(drm_np_retry.lock);
-   }
-   get_page(drm_np_retry.dummy_page);
-   return drm_np_retry.dummy_page;
-}
-
-void free_nopage_retry(void)
-{
-   if (atomic_read(drm_np_retry.present) == 1) {
-   spin_lock(drm_np_retry.lock);
-   __free_page(drm_np_retry.dummy_page);
-   drm_np_retry.dummy_page = NULL;
-   atomic_set(drm_np_retry.present, 0);
-   spin_unlock(drm_np_retry.lock);
-   }
-}
-
-struct page *drm_bo_vm_nopage(struct vm_area_struct *vma,
-  unsigned long address,
-  int *type)
-{
-   struct fault_data data;
-
-   if (type)
-   *type = VM_FAULT_MINOR;
-
-   data.address = address;
-   data.vma = vma;
-   drm_bo_vm_fault(vma, data);
-   switch (data.type) {
-   case VM_FAULT_OOM:
-   return NOPAGE_OOM;
-   case VM_FAULT_SIGBUS:
-   return NOPAGE_SIGBUS;
-   default:
-   break;
-   }
-
-   return NOPAGE_REFAULT;
-}
-
-#endif
-
 #if !defined(DRM_FULL_MM_COMPAT)  \
-  ((LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15)) || \
-   (LINUX_VERSION_CODE = KERNEL_VERSION(2,6,19)))
+  (LINUX_VERSION_CODE = KERNEL_VERSION(2,6,19))
 
 static int drm_pte_is_clear(struct vm_area_struct *vma,
unsigned long addr)
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index 937908a..d265ad1 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -152,8 +152,7 @@
 #include linux/mm.h
 #include asm/page.h
 
-#if ((LINUX_VERSION_CODE  KERNEL_VERSION(2,6,19))  \
- (LINUX_VERSION_CODE = KERNEL_VERSION(2,6,15)))
+#if (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,19))
 #define DRM_ODD_MM_COMPAT
 #endif
 
@@ -184,27 +183,6 @@ extern pgprot_t 

[PATCH 08/10] drm: drop Linux 2.6.19 support

2009-03-03 Thread Pekka Paalanen
This also means dropping the DRM_ODD_MM_COMPAT case.

Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_bo.c   |   46 
 linux-core/drm_bo_move.c  |   16 ---
 linux-core/drm_compat.c   |  272 +
 linux-core/drm_compat.h   |   82 --
 linux-core/drm_objects.h  |7 -
 linux-core/drm_vm.c   |   15 ---
 shared-core/nouveau_mem.c |2 +-
 7 files changed, 3 insertions(+), 437 deletions(-)

diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 3fb43fc..6f083f5 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -91,44 +91,13 @@ void drm_bo_add_to_lru(struct drm_buffer_object *bo)
 
 static int drm_bo_vm_pre_move(struct drm_buffer_object *bo, int old_is_pci)
 {
-#ifdef DRM_ODD_MM_COMPAT
-   int ret;
-
if (!bo-map_list.map)
return 0;
 
-   ret = drm_bo_lock_kmm(bo);
-   if (ret)
-   return ret;
drm_bo_unmap_virtual(bo);
-   if (old_is_pci)
-   drm_bo_finish_unmap(bo);
-#else
-   if (!bo-map_list.map)
-   return 0;
-
-   drm_bo_unmap_virtual(bo);
-#endif
return 0;
 }
 
-static void drm_bo_vm_post_move(struct drm_buffer_object *bo)
-{
-#ifdef DRM_ODD_MM_COMPAT
-   int ret;
-
-   if (!bo-map_list.map)
-   return;
-
-   ret = drm_bo_remap_bound(bo);
-   if (ret) {
-   DRM_ERROR(Failed to remap a bound buffer object.\n
- \tThis might cause a sigbus later.\n);
-   }
-   drm_bo_unlock_kmm(bo);
-#endif
-}
-
 /*
  * Call bo-mutex locked.
  */
@@ -237,9 +206,6 @@ static int drm_bo_handle_move_mem(struct drm_buffer_object 
*bo,
goto out_err;
 
 moved:
-   if (old_is_pci || new_is_pci)
-   drm_bo_vm_post_move(bo);
-
if (bo-priv_flags  _DRM_BO_FLAG_EVICTED) {
ret =
dev-driver-bo_driver-invalidate_caches(dev,
@@ -260,9 +226,6 @@ moved:
return 0;
 
 out_err:
-   if (old_is_pci || new_is_pci)
-   drm_bo_vm_post_move(bo);
-
new_man = bm-man[bo-mem.mem_type];
if ((new_man-flags  _DRM_FLAG_MEMTYPE_FIXED)  bo-ttm) {
drm_ttm_unbind(bo-ttm);
@@ -467,11 +430,6 @@ static void drm_bo_destroy_locked(struct drm_buffer_object 
*bo)
return;
}
 
-#ifdef DRM_ODD_MM_COMPAT
-   BUG_ON(!list_empty(bo-vma_list));
-   BUG_ON(!list_empty(bo-p_mm_list));
-#endif
-
if (bo-ttm) {
drm_ttm_unbind(bo-ttm);
drm_ttm_destroy(bo-ttm);
@@ -1784,10 +1742,6 @@ int drm_buffer_object_create(struct drm_device *dev,
INIT_LIST_HEAD(bo-lru);
INIT_LIST_HEAD(bo-pinned_lru);
INIT_LIST_HEAD(bo-ddestroy);
-#ifdef DRM_ODD_MM_COMPAT
-   INIT_LIST_HEAD(bo-p_mm_list);
-   INIT_LIST_HEAD(bo-vma_list);
-#endif
bo-dev = dev;
bo-type = type;
bo-num_pages = num_pages;
diff --git a/linux-core/drm_bo_move.c b/linux-core/drm_bo_move.c
index bf0e1b7..d794e98 100644
--- a/linux-core/drm_bo_move.c
+++ b/linux-core/drm_bo_move.c
@@ -297,10 +297,6 @@ int drm_buffer_object_transfer(struct drm_buffer_object 
*bo,
INIT_LIST_HEAD(fbo-ddestroy);
INIT_LIST_HEAD(fbo-lru);
INIT_LIST_HEAD(fbo-pinned_lru);
-#ifdef DRM_ODD_MM_COMPAT
-   INIT_LIST_HEAD(fbo-vma_list);
-   INIT_LIST_HEAD(fbo-p_mm_list);
-#endif
 
fbo-fence = drm_fence_reference_locked(bo-fence);
fbo-pinned_node = NULL;
@@ -341,20 +337,8 @@ int drm_bo_move_accel_cleanup(struct drm_buffer_object *bo,
if (ret)
return ret;
 
-#ifdef DRM_ODD_MM_COMPAT
-   /*
-* In this mode, we don't allow pipelining a copy blit,
-* since the buffer will be accessible from user space
-* the moment we return and rebuild the page tables.
-*
-* With normal vm operation, page tables are rebuilt
-* on demand using fault(), which waits for buffer idle.
-*/
-   if (1)
-#else
if (evict || ((bo-mem.mm_node == bo-pinned_node) 
  bo-mem.mm_node != NULL))
-#endif
{
if (bo-fence) {
(void) drm_fence_object_wait(bo-fence, 0, 1,
diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index ff4085d..fb39649 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -27,31 +27,7 @@
 
 #include drmP.h
 
-#if  (LINUX_VERSION_CODE  KERNEL_VERSION(2,6,19))
-
-/*
- * The protection map was exported in 2.6.19
- */
-
-pgprot_t vm_get_page_prot(unsigned long vm_flags)
-{
-#ifdef MODULE
-   static pgprot_t drm_protection_map[16] = {
-   __P000, __P001, __P010, __P011, __P100, __P101, __P110, __P111,
-   __S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
-   };
-
-   return drm_protection_map[vm_flags  0x0F];
-#else
-   extern 

[PATCH 06/10] drm: drop Linux 2.6.16 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drmP.h   |2 --
 linux-core/drm_compat.h |   10 --
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index bc68bfe..6770282 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -56,9 +56,7 @@
 #include linux/mm.h
 #include linux/kref.h
 #include linux/pagemap.h
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,16)
 #include linux/mutex.h
-#endif
 #if defined(__alpha__) || defined(__powerpc__)
 #include asm/pgtable.h   /* For pte_wrprotect */
 #endif
diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h
index d265ad1..7763da3 100644
--- a/linux-core/drm_compat.h
+++ b/linux-core/drm_compat.h
@@ -107,16 +107,6 @@
 #define IRQF_SHARED SA_SHIRQ
 #endif
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,16)
-#define mutex_lock down
-#define mutex_unlock up
-
-#define mutex semaphore
-
-#define mutex_init(a) sema_init((a), 1)
-
-#endif
-
 #ifndef DEFINE_SPINLOCK
 #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
 #endif
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 10/10] drm: drop Linux 2.6.21 support

2009-03-03 Thread Pekka Paalanen
This also means, that DRM_FULL_MM_COMPAT is always defined,
so it is dropped, too.

Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_compat.c |  164 ---
 linux-core/drm_compat.h |   26 
 linux-core/drm_vm.c |6 +--
 3 files changed, 1 insertions(+), 195 deletions(-)

diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index fb39649..0ccd2ab 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -27,168 +27,6 @@
 
 #include drmP.h
 
-#if !defined(DRM_FULL_MM_COMPAT)
-
-static int drm_pte_is_clear(struct vm_area_struct *vma,
-   unsigned long addr)
-{
-   struct mm_struct *mm = vma-vm_mm;
-   int ret = 1;
-   pte_t *pte;
-   pmd_t *pmd;
-   pud_t *pud;
-   pgd_t *pgd;
-
-   spin_lock(mm-page_table_lock);
-   pgd = pgd_offset(mm, addr);
-   if (pgd_none(*pgd))
-   goto unlock;
-   pud = pud_offset(pgd, addr);
-if (pud_none(*pud))
-   goto unlock;
-   pmd = pmd_offset(pud, addr);
-   if (pmd_none(*pmd))
-   goto unlock;
-   pte = pte_offset_map(pmd, addr);
-   if (!pte)
-   goto unlock;
-   ret = pte_none(*pte);
-   pte_unmap(pte);
- unlock:
-   spin_unlock(mm-page_table_lock);
-   return ret;
-}
-
-static int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
- unsigned long pfn)
-{
-   int ret;
-   if (!drm_pte_is_clear(vma, addr))
-   return -EBUSY;
-
-   ret = io_remap_pfn_range(vma, addr, pfn, PAGE_SIZE, vma-vm_page_prot);
-   return ret;
-}
-
-
-static struct page *drm_bo_vm_fault(struct vm_area_struct *vma,
-   struct fault_data *data)
-{
-   unsigned long address = data-address;
-   struct drm_buffer_object *bo = (struct drm_buffer_object *) 
vma-vm_private_data;
-   unsigned long page_offset;
-   struct page *page = NULL;
-   struct drm_ttm *ttm;
-   struct drm_device *dev;
-   unsigned long pfn;
-   int err;
-   unsigned long bus_base;
-   unsigned long bus_offset;
-   unsigned long bus_size;
-
-   dev = bo-dev;
-   drm_bo_read_lock(dev-bm.bm_lock, 0);
-
-   mutex_lock(bo-mutex);
-
-   err = drm_bo_wait(bo, 0, 1, 0);
-   if (err) {
-   data-type = (err == -EAGAIN) ?
-   VM_FAULT_MINOR : VM_FAULT_SIGBUS;
-   goto out_unlock;
-   }
-
-
-   /*
-* If buffer happens to be in a non-mappable location,
-* move it to a mappable.
-*/
-
-   if (!(bo-mem.flags  DRM_BO_FLAG_MAPPABLE)) {
-   unsigned long _end = jiffies + 3*DRM_HZ;
-   uint32_t new_mask = bo-mem.proposed_flags |
-   DRM_BO_FLAG_MAPPABLE |
-   DRM_BO_FLAG_FORCE_MAPPABLE;
-
-   do {
-   err = drm_bo_move_buffer(bo, new_mask, 0, 0);
-   } while((err == -EAGAIN)  !time_after_eq(jiffies, _end));
-
-   if (err) {
-   DRM_ERROR(Timeout moving buffer to mappable 
location.\n);
-   data-type = VM_FAULT_SIGBUS;
-   goto out_unlock;
-   }
-   }
-
-   if (address  vma-vm_end) {
-   data-type = VM_FAULT_SIGBUS;
-   goto out_unlock;
-   }
-
-   dev = bo-dev;
-   err = drm_bo_pci_offset(dev, bo-mem, bus_base, bus_offset,
-   bus_size);
-
-   if (err) {
-   data-type = VM_FAULT_SIGBUS;
-   goto out_unlock;
-   }
-
-   page_offset = (address - vma-vm_start)  PAGE_SHIFT;
-
-   if (bus_size) {
-   struct drm_mem_type_manager *man = 
dev-bm.man[bo-mem.mem_type];
-
-   pfn = ((bus_base + bus_offset)  PAGE_SHIFT) + page_offset;
-   vma-vm_page_prot = drm_io_prot(man-drm_bus_maptype, vma);
-   } else {
-   ttm = bo-ttm;
-
-   drm_ttm_fixup_caching(ttm);
-   page = drm_ttm_get_page(ttm, page_offset);
-   if (!page) {
-   data-type = VM_FAULT_OOM;
-   goto out_unlock;
-   }
-   pfn = page_to_pfn(page);
-   vma-vm_page_prot = (bo-mem.flags  DRM_BO_FLAG_CACHED) ?
-   vm_get_page_prot(vma-vm_flags) :
-   drm_io_prot(_DRM_TTM, vma);
-   }
-
-   err = vm_insert_pfn(vma, address, pfn);
-
-   if (!err || err == -EBUSY)
-   data-type = VM_FAULT_MINOR;
-   else
-   data-type = VM_FAULT_OOM;
-out_unlock:
-   mutex_unlock(bo-mutex);
-   drm_bo_read_unlock(dev-bm.bm_lock);
-   return NULL;
-}
-
-unsigned long drm_bo_vm_nopfn(struct vm_area_struct * vma,
-  unsigned long address)
-{
-   struct fault_data data;
-   data.address = 

[PATCH 00/10] DRM cleanup

2009-03-03 Thread Pekka Paalanen
Even 2.6.21 is about two years old now. Drop support for all kernels
before 2.6.21. This kernel version is a nice stopping point, since
it guarantees #define DRM_FULL_MM_COMPAT.

If no-one objects, I can push these into drm.git myself.

Pekka Paalanen (10):
  drm: drm_bo_mmap_locked() is static.
  drm: drop Linux = 2.6.8 support
  drm: drop Linux  2.6.10 support
  drm: drop Linux  2.6.12 support
  drm: drop Linux  2.6.15 support
  drm: drop Linux  2.6.16 support
  drm: drop Linux  2.6.18 support
  drm: drop Linux  2.6.19 support
  drm, via: drop Linux  2.6.20 support
  drm: drop Linux  2.6.21 support

 linux-core/drmP.h |8 -
 linux-core/drm_agpsupport.c   |   37 +---
 linux-core/drm_bo.c   |   66 -
 linux-core/drm_bo_move.c  |   16 --
 linux-core/drm_compat.c   |  579 -
 linux-core/drm_compat.h   |  172 
 linux-core/drm_drv.c  |3 -
 linux-core/drm_memory.c   |7 -
 linux-core/drm_memory_debug.c |4 -
 linux-core/drm_objects.h  |   11 -
 linux-core/drm_os_linux.h |   18 --
 linux-core/drm_ttm.c  |6 -
 linux-core/drm_vm.c   |   24 +--
 linux-core/mga_drv.c  |2 +-
 linux-core/nouveau_drv.c  |2 +-
 linux-core/r128_drv.c |2 +-
 linux-core/radeon_drv.c   |2 +-
 linux-core/via_dmablit.c  |   12 -
 linux-core/xgi_drv.c  |2 +-
 shared-core/nouveau_mem.c |2 +-
 20 files changed, 9 insertions(+), 966 deletions(-)


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 02/10] drm: drop Linux = 2.6.8 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drm_os_linux.h |   18 --
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h
index 8921944..4f1e83b 100644
--- a/linux-core/drm_os_linux.h
+++ b/linux-core/drm_os_linux.h
@@ -10,23 +10,6 @@
 #define DRM_CURRENTPID current-pid
 #define DRM_SUSER(p)   capable(CAP_SYS_ADMIN)
 #define DRM_UDELAY(d)  udelay(d)
-#if LINUX_VERSION_CODE = 0x020608 /* KERNEL_VERSION(2,6,8) */
-#ifndef __iomem
-#define __iomem
-#endif
-/** Read a byte from a MMIO region */
-#define DRM_READ8(map, offset) readb(((void __iomem *)(map)-handle) + 
(offset))
-/** Read a word from a MMIO region */
-#define DRM_READ16(map, offset)readw(((void __iomem 
*)(map)-handle) + (offset))
-/** Read a dword from a MMIO region */
-#define DRM_READ32(map, offset)readl(((void __iomem 
*)(map)-handle) + (offset))
-/** Write a byte into a MMIO region */
-#define DRM_WRITE8(map, offset, val)   writeb(val, ((void __iomem 
*)(map)-handle) + (offset))
-/** Write a word into a MMIO region */
-#define DRM_WRITE16(map, offset, val)  writew(val, ((void __iomem 
*)(map)-handle) + (offset))
-/** Write a dword into a MMIO region */
-#define DRM_WRITE32(map, offset, val)  writel(val, ((void __iomem 
*)(map)-handle) + (offset))
-#else
 /** Read a byte from a MMIO region */
 #define DRM_READ8(map, offset) readb((map)-handle + (offset))
 /** Read a word from a MMIO region */
@@ -39,7 +22,6 @@
 #define DRM_WRITE16(map, offset, val)  writew(val, (map)-handle + (offset))
 /** Write a dword into a MMIO region */
 #define DRM_WRITE32(map, offset, val)  writel(val, (map)-handle + (offset))
-#endif
 /** Read memory barrier */
 #define DRM_READMEMORYBARRIER()rmb()
 /** Write memory barrier */
-- 
1.6.0.6


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 04/10] drm: drop Linux 2.6.12 support

2009-03-03 Thread Pekka Paalanen
Signed-off-by: Pekka Paalanen p...@iki.fi
---
 linux-core/drmP.h |6 --
 linux-core/drm_agpsupport.c   |   37 +
 linux-core/drm_memory.c   |7 ---
 linux-core/drm_memory_debug.c |4 
 4 files changed, 1 insertions(+), 53 deletions(-)

diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 002ad3d..bc68bfe 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -517,9 +517,7 @@ struct drm_agp_head {
DRM_AGP_KERN agp_info;  /** AGP device information */
struct list_head memory;
unsigned long mode; /** AGP mode */
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,11)
struct agp_bridge_data *bridge;
-#endif
int enabled;/** whether the AGP bus as been 
enabled */
int acquired;   /** whether the AGP device has been 
acquired */
unsigned long base;
@@ -1279,11 +1277,7 @@ extern int drm_agp_unbind_ioctl(struct drm_device *dev, 
void *data,
 extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding 
*request);
 extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-extern DRM_AGP_MEM *drm_agp_allocate_memory(size_t pages, u32 type);
-#else
 extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, 
size_t pages, u32 type);
-#endif
 extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
 extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
 extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 3cc94ff..2abfac6 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -94,21 +94,12 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data,
  */
 int drm_agp_acquire(struct drm_device * dev)
 {
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   int retcode;
-#endif
-
if (!dev-agp)
return -ENODEV;
if (dev-agp-acquired)
return -EBUSY;
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   if ((retcode = agp_backend_acquire()))
-   return retcode;
-#else
if (!(dev-agp-bridge = agp_backend_acquire(dev-pdev)))
return -ENODEV;
-#endif
 
dev-agp-acquired = 1;
return 0;
@@ -145,11 +136,7 @@ int drm_agp_release(struct drm_device *dev)
 {
if (!dev-agp || !dev-agp-acquired)
return -EINVAL;
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   agp_backend_release();
-#else
agp_backend_release(dev-agp-bridge);
-#endif
dev-agp-acquired = 0;
return 0;
 
@@ -178,11 +165,7 @@ int drm_agp_enable(struct drm_device *dev, struct 
drm_agp_mode mode)
return -EINVAL;
 
dev-agp-mode = mode.mode;
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   agp_enable(mode.mode);
-#else
agp_enable(dev-agp-bridge, mode.mode);
-#endif
dev-agp-enabled = 1;
return 0;
 }
@@ -418,9 +401,6 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
return NULL;
memset((void *)head, 0, sizeof(*head));
 
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   agp_copy_info(head-agp_info);
-#else
head-bridge = agp_find_bridge(dev-pdev);
if (!head-bridge) {
if (!(head-bridge = agp_backend_acquire(dev-pdev))) {
@@ -432,7 +412,7 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
} else {
agp_copy_info(head-bridge, head-agp_info);
}
-#endif
+
if (head-agp_info.chipset == NOT_SUPPORTED) {
drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS);
return NULL;
@@ -445,18 +425,11 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 }
 
 /** Calls agp_allocate_memory() */
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-DRM_AGP_MEM *drm_agp_allocate_memory(size_t pages, u32 type)
-{
-   return agp_allocate_memory(pages, type);
-}
-#else
 DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge,
 size_t pages, u32 type)
 {
return agp_allocate_memory(bridge, pages, type);
 }
-#endif
 
 /** Calls agp_free_memory() */
 int drm_agp_free_memory(DRM_AGP_MEM * handle)
@@ -501,12 +474,8 @@ drm_agp_bind_pages(struct drm_device *dev,
int ret, i;
 
DRM_DEBUG(drm_agp_populate_ttm\n);
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,11)
-   mem = drm_agp_allocate_memory(num_pages, AGP_USER_MEMORY);
-#else
mem = drm_agp_allocate_memory(dev-agp-bridge, num_pages,
  AGP_USER_MEMORY);
-#endif
if (mem == NULL) {
DRM_ERROR(Failed to allocate memory for %ld pages\n,
  num_pages);
@@ -561,11 +530,7 @@ static int drm_agp_populate(struct 

[Bug 12634] video distortion and lockup with i830 video chip and 2.6.28.3

2009-03-03 Thread bugme-daemon
http://bugzilla.kernel.org/show_bug.cgi?id=12634





--- Comment #18 from pappy_mc...@yahoo.com  2009-03-03 14:54 ---
Still remains.


-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


RE: Additional DRM Version Info

2009-03-03 Thread Tu, Yun
Calvin:
I think psb drm driver is not in freedesktop.net’s public drm repository, right?
Thanks
Mark

From: Zhao, Chunfeng [mailto:chunfeng.z...@intel.com]
Sent: 2009年3月4日 3:20
To: Zhao, Chunfeng; Johnson, Charles F; dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

And the xorg.0.log message is saying that the psb_dri.so is expecting psb.ko to 
be 5.x.x-7.0.0, but it see a psb.ko with version of 8.0.0 was loaded. It means 
that the psb_dri.so is a little bit old.

Calvin


From: Zhao, Chunfeng
Sent: Tuesday, March 03, 2009 11:17 AM
To: Johnson, Charles F; dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

Hi Charles,
In the kernel driver tree, umg-moorestown-drm-tg, psb_drv.h, it define the 
version info for kernel driver psb.ko:
#define PSB_DRM_DRIVER_DATE “20081216”
#define PSB_DRM_DRIVER_MAJOR 8
#define PSB_DRM_DRIVER_MINOR 0
#define PAB_DRM_DRIVER_PATCHLEVEL 0

During driver load, this version info will be loaded and checked against the 
user mode 3D driver psb_dri.so, psb_dri.so should be in sync with psb.ko, and 
both driver is updated from time to time, the versioning will updated if they 
need to be resync up.

Hope this answer your question?

Calvin


From: Johnson, Charles F [mailto:charles.f.john...@intel.com]
Sent: Tuesday, March 03, 2009 11:06 AM
To: dri-devel@lists.sourceforge.net
Subject: Additional DRM Version Info

Concerning my earlier email concern DRM versioning,  how does the version in 
the following Xorg.0.log text relate to the DRM version in the kernel and 
libdrm:

Kernel DRM version: 8.0.0
and I can work with versions 5.0.x - 7.x.x
Please update either this 2D driver or your kernel DRM.
Disabling DRI.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


RE: Additional DRM Version Info

2009-03-03 Thread Zhao, Chunfeng
Hi Yun,
No, Charles was asking the open source folks for a generic DRM versioning 
question, it will apply to all HW driver I think.

Calvin


From: Tu, Yun
Sent: Tuesday, March 03, 2009 4:44 PM
To: Zhao, Chunfeng; Zhao, Chunfeng; Johnson, Charles F; 
dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

Calvin:
I think psb drm driver is not in freedesktop.net’s public drm repository, right?
Thanks
Mark

From: Zhao, Chunfeng [mailto:chunfeng.z...@intel.com]
Sent: 2009年3月4日 3:20
To: Zhao, Chunfeng; Johnson, Charles F; dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

And the xorg.0.log message is saying that the psb_dri.so is expecting psb.ko to 
be 5.x.x-7.0.0, but it see a psb.ko with version of 8.0.0 was loaded. It means 
that the psb_dri.so is a little bit old.

Calvin


From: Zhao, Chunfeng
Sent: Tuesday, March 03, 2009 11:17 AM
To: Johnson, Charles F; dri-devel@lists.sourceforge.net
Subject: RE: Additional DRM Version Info

Hi Charles,
In the kernel driver tree, umg-moorestown-drm-tg, psb_drv.h, it define the 
version info for kernel driver psb.ko:
#define PSB_DRM_DRIVER_DATE “20081216”
#define PSB_DRM_DRIVER_MAJOR 8
#define PSB_DRM_DRIVER_MINOR 0
#define PAB_DRM_DRIVER_PATCHLEVEL 0

During driver load, this version info will be loaded and checked against the 
user mode 3D driver psb_dri.so, psb_dri.so should be in sync with psb.ko, and 
both driver is updated from time to time, the versioning will updated if they 
need to be resync up.

Hope this answer your question?

Calvin


From: Johnson, Charles F [mailto:charles.f.john...@intel.com]
Sent: Tuesday, March 03, 2009 11:06 AM
To: dri-devel@lists.sourceforge.net
Subject: Additional DRM Version Info

Concerning my earlier email concern DRM versioning,  how does the version in 
the following Xorg.0.log text relate to the DRM version in the kernel and 
libdrm:

Kernel DRM version: 8.0.0
and I can work with versions 5.0.x - 7.x.x
Please update either this 2D driver or your kernel DRM.
Disabling DRI.


Charles Johnson
Ultra-Mobility Group
UPSG Architecture
Intel Corporation
charles.f.john...@intel.com



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/i915: Fix TV get_modes to return modes count

2009-03-03 Thread Zhenyu Wang
TV modes count must be returned in get_modes.
This also fixed TV mode's clock calculation int
overflow issue, and use 0.01 precision for mode
refresh validation.

Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/intel_tv.c |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 56485d6..21cddea 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1082,7 +1082,7 @@ intel_tv_mode_valid(struct drm_connector *connector, 
struct drm_display_mode *mo
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
 
/* Ensure TV refresh is close to desired refresh */
-   if (tv_mode  abs(tv_mode-refresh - drm_mode_vrefresh(mode))  1)
+   if (tv_mode  abs(tv_mode-refresh - drm_mode_vrefresh(mode))  10)
return MODE_OK;
return MODE_CLOCK_RANGE;
 }
@@ -1495,7 +1495,8 @@ intel_tv_get_modes(struct drm_connector *connector)
struct drm_display_mode *mode_ptr;
struct intel_output *intel_output = to_intel_output(connector);
const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
-   int j;
+   int j, count = 0;
+   u64 tmp;
 
for (j = 0; j  sizeof(input_res_table) / sizeof(input_res_table[0]);
 j++) {
@@ -1510,8 +1511,9 @@ intel_tv_get_modes(struct drm_connector *connector)
 !tv_mode-component_only))
continue;
 
-   mode_ptr = drm_calloc(1, sizeof(struct drm_display_mode),
- DRM_MEM_DRIVER);
+   mode_ptr = drm_mode_create(connector-dev);
+   if (!mode_ptr)
+   continue;
strncpy(mode_ptr-name, input-name, DRM_DISPLAY_MODE_LEN);
 
mode_ptr-hdisplay = hactive_s;
@@ -1528,15 +1530,17 @@ intel_tv_get_modes(struct drm_connector *connector)
mode_ptr-vsync_end = mode_ptr-vsync_start  + 1;
mode_ptr-vtotal = vactive_s + 33;
 
-   mode_ptr-clock = (int) (tv_mode-refresh *
-mode_ptr-vtotal *
-mode_ptr-htotal / 1000) / 1000;
+   tmp = (u64) tv_mode-refresh * mode_ptr-vtotal;
+   tmp *= mode_ptr-htotal;
+   tmp = div_u64(tmp, 100);
+   mode_ptr-clock = (int) tmp;
 
mode_ptr-type = DRM_MODE_TYPE_DRIVER;
drm_mode_probed_add(connector, mode_ptr);
+   count++;
}
 
-   return 0;
+   return count;
 }
 
 static void
-- 
1.5.6.5


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/i915: TV mode_set sync up with 2D driver

2009-03-03 Thread Zhenyu Wang
Fix TV control save register for untouched bits, and color
knobs different definition for 945 and 965 chips.

Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/i915_reg.h |2 +-
 drivers/gpu/drm/i915/intel_tv.c |   11 ---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 9d6539a..0ae0274 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -855,7 +855,7 @@
  */
 # define TV_ENC_C0_FIX (1  10)
 /** Bits that must be preserved by software */
-# define TV_CTL_SAVE   ((3  8) | (3  6))
+# define TV_CTL_SAVE   ((1  11) | (3  9) | (7  6) | 0xf)
 # define TV_FUSE_STATE_MASK(3  4)
 /** Read-only state that reports all features enabled */
 # define TV_FUSE_STATE_ENABLED (0  4)
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 21cddea..5c406a1 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1135,7 +1135,8 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct 
drm_display_mode *mode,
if (!tv_mode)
return; /* can't happen (mode_prepare prevents this) */
 
-   tv_ctl = 0;
+   tv_ctl = I915_READ(TV_CTL);
+   tv_ctl = TV_CTL_SAVE;
 
switch (tv_priv-type) {
default:
@@ -1215,7 +1216,6 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct 
drm_display_mode *mode,
/* dda1 implies valid video levels */
if (tv_mode-dda1_inc) {
scctl1 |= TV_SC_DDA1_EN;
-   scctl1 |= video_levels-burst  TV_BURST_LEVEL_SHIFT;
}
 
if (tv_mode-dda2_inc)
@@ -1225,6 +1225,7 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct 
drm_display_mode *mode,
scctl1 |= TV_SC_DDA3_EN;
 
scctl1 |= tv_mode-sc_reset;
+   scctl1 |= video_levels-burst  TV_BURST_LEVEL_SHIFT;
scctl1 |= tv_mode-dda1_inc  TV_SCDDA1_INC_SHIFT;
 
scctl2 = tv_mode-dda2_size  TV_SCDDA2_SIZE_SHIFT |
@@ -1266,7 +1267,11 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct 
drm_display_mode *mode,
   color_conversion-av);
}
 
-   I915_WRITE(TV_CLR_KNOBS, 0x00606000);
+   if (IS_I965G(dev))
+   I915_WRITE(TV_CLR_KNOBS, 0x00404000);
+   else
+   I915_WRITE(TV_CLR_KNOBS, 0x00606000);
+
if (video_levels)
I915_WRITE(TV_CLR_LEVEL,
   ((video_levels-black  TV_BLACK_LEVEL_SHIFT) |
-- 
1.5.6.5


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/i915: TV detection fix

2009-03-03 Thread Zhenyu Wang
Check encoder has real enabled crtc for TV detect, and
fix missing TV type setting after detect.

Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/intel_tv.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 5c406a1..f95dc4d 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1406,6 +1406,7 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct 
intel_output *intel_output)
tv_dac = I915_READ(TV_DAC);
I915_WRITE(TV_DAC, save_tv_dac);
I915_WRITE(TV_CTL, save_tv_ctl);
+   intel_wait_for_vblank(dev);
}
/*
 *  A B C
@@ -1456,7 +1457,7 @@ intel_tv_detect(struct drm_connector *connector)
mode = reported_modes[0];
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
 
-   if (encoder-crtc) {
+   if (encoder-crtc  encoder-crtc-enabled) {
type = intel_tv_detect_type(encoder-crtc, intel_output);
} else {
crtc = intel_get_load_detect_pipe(intel_output, mode, 
dpms_mode);
@@ -1467,6 +1468,8 @@ intel_tv_detect(struct drm_connector *connector)
type = -1;
}
 
+   tv_priv-type = type;
+
if (type  0)
return connector_status_disconnected;
 
-- 
1.5.6.5


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread Zhenyu Wang
On 2009.03.03 18:25:39 +0800, Steven J Newbury wrote:
 On Tue, 2009-03-03 at 17:48 +0800, yakui_zhao wrote:
  Hi
  the following is the patch set for KMS about CRT/LVDS. I have tested 
  them on the
  T61 box.
  patch 01: add the CRT save/restore for VT switch
  patch 02: Sync crt mode_valid/mode_set with intel driver
  patch 03: sync CRT hotplug detection with intel driver
  patch 04: add the load-detection for CRT
  patch 05: sync LVDS save/restore with intel driver(Of course the 
  possible_crtcs/clones is
  added explicitly).
   
  
  Thanks for the comments.
 Yakui
  
 While you are working on this, any chance you could look at the KMS
 S-Video initial detection path? For some reason TV out is detected on
 boot despite not being connected. X initialisation triggers detection,
 but by then xrandr has decided the screen0 is the TV out, resulting in
 panels etc. being placed in the middle of the screen until X is
 restarted.
 

Could you try the last three TV KMS patches I've sent? That really makes
TV KMS light up for me.

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: Digital signature
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread Steven J Newbury
On Wed, 2009-03-04 at 10:28 +0800, Zhenyu Wang wrote:
 On 2009.03.03 18:25:39 +0800, Steven J Newbury wrote:
...
  While you are working on this, any chance you could look at the KMS
  S-Video initial detection path? For some reason TV out is detected on
  boot despite not being connected. X initialisation triggers detection,
  but by then xrandr has decided the screen0 is the TV out, resulting in
  panels etc. being placed in the middle of the screen until X is
  restarted.
  
 
 Could you try the last three TV KMS patches I've sent? That really makes
 TV KMS light up for me.
 
Do you have a public git repo I can pull from?


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread Wang, Zhenyu Z
On 2009.03.04 10:49:39 +0800, Steven J Newbury wrote:
 On Wed, 2009-03-04 at 10:28 +0800, Zhenyu Wang wrote:
  On 2009.03.03 18:25:39 +0800, Steven J Newbury wrote:
 ...
   While you are working on this, any chance you could look at the KMS
   S-Video initial detection path? For some reason TV out is detected on
   boot despite not being connected. X initialisation triggers detection,
   but by then xrandr has decided the screen0 is the TV out, resulting in
   panels etc. being placed in the middle of the screen until X is
   restarted.
   
  
  Could you try the last three TV KMS patches I've sent? That really makes
  TV KMS light up for me.
  
 Do you have a public git repo I can pull from?

No, git-am should work for you.

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: Digital signature
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/i915: TV modes' parameters sync up with 2D driver

2009-03-03 Thread Zhenyu Wang
Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/intel_tv.c |  112 +++---
 1 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index f95dc4d..ceca947 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -217,8 +217,8 @@ static const u32 filter_table[] = {
  */
 static const struct color_conversion ntsc_m_csc_composite = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
-   .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0f00,
-   .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0f00,
+   .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0200,
+   .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0200,
 };
 
 static const struct video_levels ntsc_m_levels_composite = {
@@ -226,9 +226,9 @@ static const struct video_levels ntsc_m_levels_composite = {
 };
 
 static const struct color_conversion ntsc_m_csc_svideo = {
-   .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0134,
-   .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0f00,
-   .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0f00,
+   .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0133,
+   .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0200,
+   .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0200,
 };
 
 static const struct video_levels ntsc_m_levels_svideo = {
@@ -237,8 +237,8 @@ static const struct video_levels ntsc_m_levels_svideo = {
 
 static const struct color_conversion ntsc_j_csc_composite = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0119,
-   .ru = 0x074c, .gu = 0x0546, .bu = 0x05ec, .au = 0x0f00,
-   .rv = 0x035a, .gv = 0x0322, .bv = 0x06e1, .av = 0x0f00,
+   .ru = 0x074c, .gu = 0x0546, .bu = 0x05ec, .au = 0x0200,
+   .rv = 0x035a, .gv = 0x0322, .bv = 0x06e1, .av = 0x0200,
 };
 
 static const struct video_levels ntsc_j_levels_composite = {
@@ -247,8 +247,8 @@ static const struct video_levels ntsc_j_levels_composite = {
 
 static const struct color_conversion ntsc_j_csc_svideo = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x014c,
-   .ru = 0x0788, .gu = 0x0581, .bu = 0x0322, .au = 0x0f00,
-   .rv = 0x0399, .gv = 0x0356, .bv = 0x070a, .av = 0x0f00,
+   .ru = 0x0788, .gu = 0x0581, .bu = 0x0322, .au = 0x0200,
+   .rv = 0x0399, .gv = 0x0356, .bv = 0x070a, .av = 0x0200,
 };
 
 static const struct video_levels ntsc_j_levels_svideo = {
@@ -257,8 +257,8 @@ static const struct video_levels ntsc_j_levels_svideo = {
 
 static const struct color_conversion pal_csc_composite = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0113,
-   .ru = 0x0745, .gu = 0x053f, .bu = 0x05e1, .au = 0x0f00,
-   .rv = 0x0353, .gv = 0x031c, .bv = 0x06dc, .av = 0x0f00,
+   .ru = 0x0745, .gu = 0x053f, .bu = 0x05e1, .au = 0x0200,
+   .rv = 0x0353, .gv = 0x031c, .bv = 0x06dc, .av = 0x0200,
 };
 
 static const struct video_levels pal_levels_composite = {
@@ -267,8 +267,8 @@ static const struct video_levels pal_levels_composite = {
 
 static const struct color_conversion pal_csc_svideo = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0145,
-   .ru = 0x0780, .gu = 0x0579, .bu = 0x031c, .au = 0x0f00,
-   .rv = 0x0390, .gv = 0x034f, .bv = 0x0705, .av = 0x0f00,
+   .ru = 0x0780, .gu = 0x0579, .bu = 0x031c, .au = 0x0200,
+   .rv = 0x0390, .gv = 0x034f, .bv = 0x0705, .av = 0x0200,
 };
 
 static const struct video_levels pal_levels_svideo = {
@@ -277,8 +277,8 @@ static const struct video_levels pal_levels_svideo = {
 
 static const struct color_conversion pal_m_csc_composite = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
-   .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0f00,
-   .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0f00,
+   .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0200,
+   .rv = 0x0340, .gv = 0x030c, .bv = 0x06d0, .av = 0x0200,
 };
 
 static const struct video_levels pal_m_levels_composite = {
@@ -286,9 +286,9 @@ static const struct video_levels pal_m_levels_composite = {
 };
 
 static const struct color_conversion pal_m_csc_svideo = {
-   .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0134,
-   .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0f00,
-   .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0f00,
+   .ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0133,
+   .ru = 0x076a, .gu = 0x0564, .bu = 0x030d, .au = 0x0200,
+   .rv = 0x037a, .gv = 0x033d, .bv = 0x06f6, .av = 0x0200,
 };
 
 static const struct video_levels pal_m_levels_svideo = {
@@ -297,8 +297,8 @@ static const struct video_levels pal_m_levels_svideo = {
 
 static const struct color_conversion pal_n_csc_composite = {
.ry = 0x0332, .gy = 0x012d, .by = 0x07d3, .ay = 0x0104,
-   .ru = 0x0733, .gu = 0x052d, .bu = 0x05c7, .au = 0x0f00,
-   .rv = 0x0340, .gv = 

[Bug 19504] [945GM] glitch in ut2004, regression

2009-03-03 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=19504





--- Comment #11 from haihao haihao.xi...@intel.com  2009-03-03 19:48:08 PST 
---
I tested it against mesa_7_4_branch(819b028a8e74bf67d28bf8b29efc7cc5dcb2a758)
on a x86 box, and it worked fine with game type Invasion and DeathMatch and map
DM_HyperBlast2. Could you try it again?


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [Patch 0/5]: the patch set for kms about CRT/LVDS

2009-03-03 Thread yakui_zhao
On Tue, 2009-03-03 at 18:25 +0800, Steven J Newbury wrote:
 On Tue, 2009-03-03 at 17:48 +0800, yakui_zhao wrote:
  Hi
  the following is the patch set for KMS about CRT/LVDS. I have tested 
  them on the
  T61 box.
  patch 01: add the CRT save/restore for VT switch
  patch 02: Sync crt mode_valid/mode_set with intel driver
  patch 03: sync CRT hotplug detection with intel driver
  patch 04: add the load-detection for CRT
  patch 05: sync LVDS save/restore with intel driver(Of course the 
  possible_crtcs/clones is
  added explicitly).
   
  
  Thanks for the comments.
 Yakui
  
 While you are working on this, any chance you could look at the KMS
 S-Video initial detection path? For some reason TV out is detected on
 boot despite not being connected. X initialisation triggers detection,
 but by then xrandr has decided the screen0 is the TV out, resulting in
 panels etc. being placed in the middle of the screen until X is
 restarted.
Thanks for your info. It seems that the TV detection is not correct.
I am looking at this issue. But it will need some time.

Thanks.
 


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel