[PATCH] drm/i915: Fix SDVO TV support

2009-03-24 Thread Zhenyu Wang
This brings SDVO TV support from 2D driver, including origin
fix f1ca56e17d0 and later fix 2fcf4fcccfe. Also fix wrong modeline
definitions for SDVO TV.

Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/intel_display.c |   20 +
 drivers/gpu/drm/i915/intel_sdvo.c|  140 +-
 2 files changed, 108 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index d9c50ff..d99f313 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1106,6 +1106,26 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
return -EINVAL;
}
 
+   /* SDVO TV has fixed PLL values depend on its clock range,
+  this mirrors vbios setting. */
+   if (is_sdvo  is_tv) {
+   if (adjusted_mode-clock = 10
+adjusted_mode-clock  140500) {
+   clock.p1 = 2;
+   clock.p2 = 10;
+   clock.n = 3;
+   clock.m1 = 16;
+   clock.m2 = 8;
+   } else if (adjusted_mode-clock = 140500
+adjusted_mode-clock = 20) {
+   clock.p1 = 1;
+   clock.p2 = 10;
+   clock.n = 6;
+   clock.m1 = 12;
+   clock.m2 = 8;
+   }
+   }
+
if (IS_IGD(dev))
fp = (1  clock.n)  16 | clock.m1  8 | clock.m2;
else
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c 
b/drivers/gpu/drm/i915/intel_sdvo.c
index ea311c7..7b31f55 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -911,6 +911,27 @@ static void intel_sdvo_set_avi_infoframe(struct 
intel_output *output,
SDVO_HBUF_TX_VSYNC);
 }
 
+static void intel_sdvo_set_tv_format(struct intel_output *output)
+{
+   struct intel_sdvo_priv *sdvo_priv = output-dev_priv;
+   struct intel_sdvo_tv_format *format, unset;
+   u8 status;
+
+   format = sdvo_priv-tv_format;
+   memset(unset, 0, sizeof(unset));
+   if (memcmp(format, unset, sizeof(*format))) {
+   DRM_DEBUG(%s: Choosing default TV format of NTSC-M\n,
+   SDVO_NAME(sdvo_priv));
+   format-ntsc_m = 1;
+   intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, format,
+   sizeof(*format));
+   status = intel_sdvo_read_response(output, NULL, 0);
+   if (status != SDVO_CMD_STATUS_SUCCESS)
+   DRM_DEBUG(%s: Failed to set TV format\n,
+   SDVO_NAME(sdvo_priv));
+   }
+}
+
 static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
  struct drm_display_mode *mode,
  struct drm_display_mode *adjusted_mode)
@@ -955,6 +976,12 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder 
*encoder,
 input_dtd);
intel_sdvo_get_mode_from_dtd(adjusted_mode, input_dtd);
 
+   drm_mode_set_crtcinfo(adjusted_mode, 0);
+
+   mode-clock = adjusted_mode-clock;
+
+   adjusted_mode-clock *=
+   intel_sdvo_get_pixel_multiplier(mode);
} else {
return false;
}
@@ -999,7 +1026,12 @@ static void intel_sdvo_mode_set(struct drm_encoder 
*encoder,
sdvox |= SDVO_AUDIO_ENABLE;
}
 
-   intel_sdvo_get_dtd_from_mode(input_dtd, mode);
+   /* We have tried to get input timing in mode_fixup, and filled into
+  adjusted_mode */
+   if (sdvo_priv-is_tv)
+   intel_sdvo_get_dtd_from_mode(input_dtd, adjusted_mode);
+   else
+   intel_sdvo_get_dtd_from_mode(input_dtd, mode);
 
/* If it's a TV, we already set the output timing in mode_fixup.
 * Otherwise, the output timing is equal to the input timing.
@@ -1014,6 +1046,9 @@ static void intel_sdvo_mode_set(struct drm_encoder 
*encoder,
/* Set the input timing to the screen. Assume always input 0. */
intel_sdvo_set_target_input(output, true, false);
 
+   if (sdvo_priv-is_tv)
+   intel_sdvo_set_tv_format(output);
+
/* We would like to use intel_sdvo_create_preferred_input_timing() to
 * provide the device with a timing it can support, if it supports that
 * feature.  However, presumably we would need to adjust the CRTC to
@@ -1382,7 +1417,7 @@ static void
 intel_sdvo_check_tv_format(struct intel_output *output)
 {
struct intel_sdvo_priv *dev_priv = output-dev_priv;
-   struct intel_sdvo_tv_format format, unset;
+   struct 

[PATCH] drm/i915: Fix SDVO command debug function

2009-03-24 Thread Zhenyu Wang
Fix compile error of intel_sdvo_debug_response(),
and explicit use KERN_DEBUG for printk.

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

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c 
b/drivers/gpu/drm/i915/intel_sdvo.c
index fbe6f39..fbf18cb 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -273,20 +273,20 @@ static void intel_sdvo_debug_write(struct intel_output 
*intel_output, u8 cmd,
struct intel_sdvo_priv *sdvo_priv = intel_output-dev_priv;
int i;
 
-   DRM_DEBUG(%s: W: %02X , SDVO_NAME(sdvo_priv), cmd);
+   printk(KERN_DEBUG %s: W: %02X , SDVO_NAME(sdvo_priv), cmd);
for (i = 0; i  args_len; i++)
-   printk(%02X , ((u8 *)args)[i]);
+   printk(KERN_DEBUG %02X , ((u8 *)args)[i]);
for (; i  8; i++)
-   printk(   );
+   printk(KERN_DEBUG);
for (i = 0; i  sizeof(sdvo_cmd_names) / sizeof(sdvo_cmd_names[0]); 
i++) {
if (cmd == sdvo_cmd_names[i].cmd) {
-   printk((%s), sdvo_cmd_names[i].name);
+   printk(KERN_DEBUG (%s), sdvo_cmd_names[i].name);
break;
}
}
if (i == sizeof(sdvo_cmd_names)/ sizeof(sdvo_cmd_names[0]))
-   printk((%02X),cmd);
-   printk(\n);
+   printk(KERN_DEBUG (%02X), cmd);
+   printk(KERN_DEBUG \n);
 }
 #else
 #define intel_sdvo_debug_write(o, c, a, l)
@@ -323,17 +323,18 @@ static void intel_sdvo_debug_response(struct intel_output 
*intel_output,
  u8 status)
 {
struct intel_sdvo_priv *sdvo_priv = intel_output-dev_priv;
+   int i;
 
-   DRM_DEBUG(%s: R: , SDVO_NAME(sdvo_priv));
+   printk(KERN_DEBUG %s: R: , SDVO_NAME(sdvo_priv));
for (i = 0; i  response_len; i++)
-   printk(%02X , ((u8 *)response)[i]);
+   printk(KERN_DEBUG %02X , ((u8 *)response)[i]);
for (; i  8; i++)
-   printk(   );
+   printk(KERN_DEBUG);
if (status = SDVO_CMD_STATUS_SCALING_NOT_SUPP)
-   printk((%s), cmd_status_names[status]);
+   printk(KERN_DEBUG (%s), cmd_status_names[status]);
else
-   printk((??? %d), status);
-   printk(\n);
+   printk(KERN_DEBUG (??? %d), status);
+   printk(KERN_DEBUG \n);
 }
 #else
 #define intel_sdvo_debug_response(o, r, l, s)
-- 
1.5.6.5


--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/i915: Fix SDVO CREATE_PREFERRED_INPUT_TIMING command

2009-03-24 Thread Zhenyu Wang
This brings fix commit acde0ef683 from 2D driver.

Signed-off-by: Zhenyu Wang zhenyu.z.w...@intel.com
---
 drivers/gpu/drm/i915/intel_sdvo.c  |3 +++
 drivers/gpu/drm/i915/intel_sdvo_regs.h |3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c 
b/drivers/gpu/drm/i915/intel_sdvo.c
index 31cd9b8..ea311c7 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -589,9 +589,12 @@ intel_sdvo_create_preferred_input_timing(struct 
intel_output *output,
struct intel_sdvo_preferred_input_timing_args args;
uint8_t status;
 
+   memset(args, 0, sizeof(args));
args.clock = clock;
args.width = width;
args.height = height;
+   args.interlace = 0;
+   args.scaled = 0;
intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING,
 args, sizeof(args));
status = intel_sdvo_read_response(output, NULL, 0);
diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h 
b/drivers/gpu/drm/i915/intel_sdvo_regs.h
index 1117b9c..193938b 100644
--- a/drivers/gpu/drm/i915/intel_sdvo_regs.h
+++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h
@@ -100,6 +100,9 @@ struct intel_sdvo_preferred_input_timing_args {
 u16 clock;
 u16 width;
 u16 height;
+u8 interlace:1;
+u8 scaled:1;
+u8 pad:6;
 } __attribute__((packed));
 
 /* I2C registers for SDVO */
-- 
1.5.6.5


--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Intel-gfx] [RFC][PATCH] drm: detect hdmi monitor by hdmi identifier (v1)

2009-03-24 Thread Ma Ling
On Sat, 2009-03-21 at 04:03 +0800, Eric Anholt wrote:
 On Fri, 2009-03-20 at 15:52 +0800, Ma Ling wrote:
  sometime we need to communicate with HDMI monitor by sending audio or video 
  info frame,
  so we have to know the monitor type. However if user utilize HDMI-DVI 
  adapter to connect DVI monitor,
  hardware detection will incorrectly shows the monitor is HDMI.
  HDMI spec tell us that any device containing IEEE Registration Identifier 
  will be
  treated HDMI device. The patch intends to detect HDMI monitor by this rule. 

  
  Any comments are welcome.
 
 Most consumers of this API will have just fetched the EDID block for
 another reason, but this code would just go and fetch it again.  It
 seems like this function should probably drm_edid_block_is_hdmi(struct
 edid *edid).  Or is there some problem here?
Thanks , I agree, fixed in next version.
 
  Thanks
  Ma Ling
  
  Signed-off-by: Ma Ling ling...@intel.com
  ---
   drivers/gpu/drm/drm_edid.c |   68 
  
   include/drm/drm_crtc.h |2 +
   2 files changed, 70 insertions(+), 0 deletions(-)
  
  diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
  index a839a28..f92babe 100644
  --- a/drivers/gpu/drm/drm_edid.c
  +++ b/drivers/gpu/drm/drm_edid.c
  @@ -677,6 +677,74 @@ struct edid *drm_get_edid(struct drm_connector 
  *connector,
   }
   EXPORT_SYMBOL(drm_get_edid);
   
  +#define HDMI_IDENTIFIER 0x000C03
  +#define VENDOR_BLOCK0x03
  +/**
  + * drm_detect_hdmi_monitor - detect whether monitor is hdmi.
  + * @connector: connector we're probing
  + * @adapter: i2c adapter to use for DDC
  + *
  + * Parse the CEA extension according to CEA-861-B.
  + * Return true if HDMI, false if not or unknown.
  + */
  +bool drm_detect_hdmi_monitor(struct drm_connector *connector,
  +struct i2c_adapter *adapter)
  +{
  +   struct edid *edid;
  +   char *edid_ext = NULL;
  +   int start_offset, end_offset;
  +   int i, hdmi_id;
  +   bool ret = false;
 
 since ret isn't 0 for success, -ESOMETHING for failure, could it get
 renamed to is_hdmi or something?
fixed.
 
  +
  +   edid = drm_get_edid(connector, adapter);
  +
  +   /* No EDID or EDID extensions */
  +   if (edid == NULL || edid-extensions == 0)
  +   goto end;
  +
  +   /* Find CEA extension */
  +   for (i = 0; i  edid-extensions; i++) {
  +   edid_ext = (char *)edid + EDID_LENGTH * (i + 1);
  +   /* This block is CEA extension */
  +   if (edid_ext[0] == 0x02)
  +   break;
  +   }
  +
  +   if (i == edid-extensions)
  +   goto end;
  +
  +   /* Data block offset in CEA extension block */
  +   start_offset = 4;
  +   end_offset = edid_ext[2];
  +
  +   /*
  +* Because HDMI identifier is in Vendor Specific Block,
  +* search it from all data blocks of CEA extension.
  +*/
  +   for (i = start_offset; i  end_offset;
  +   /* Increased by data block len */
  +   i += ((edid_ext[i]  0x1f) + 1)) {
 
 indentation alignment
fixed.
 
  +   /* Find vendor specific block */
  +   if ((edid_ext[i]  5) == VENDOR_BLOCK) {
  +   hdmi_id = edid_ext[i + 1] | (edid_ext[i + 2]  8) |
  + edid_ext[i + 3]  16;
  +   /* Find HDMI identifier */
  +   if (hdmi_id == HDMI_IDENTIFIER)
  +   ret = true;
  +   break;
  +   }
  +   }
  +
  +end:
  +   if (edid != NULL) {
  +   connector-display_info.raw_edid = NULL;
  +   kfree(edid);
  +   }
  +
  +   return ret;
  +}
  +EXPORT_SYMBOL(drm_detect_hdmi_monitor);
  +
   /**
* drm_add_edid_modes - add modes from EDID data, if available
* @connector: connector we're probing
  diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
  index 5ded1ac..e578f55 100644
  --- a/include/drm/drm_crtc.h
  +++ b/include/drm/drm_crtc.h
  @@ -731,4 +731,6 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device 
  *dev,
  void *data, struct drm_file *file_priv);
   extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
  void *data, struct drm_file *file_priv);
  +extern bool drm_detect_hdmi_monitor(struct drm_connector *connector,
  +   struct i2c_adapter *adapter);
   #endif /* __DRM_CRTC_H__ */


--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net

[PATCH] drm: detect hdmi monitor by hdmi identifier (v2)

2009-03-24 Thread Ma Ling
Sometime we need to communicate with HDMI monitor by sending audio or video 
info frame,
so we have to know the monitor type. However if user utilize HDMI-DVI adaptor 
to connect DVI monitor,
hardware detection will incorrectly shows the monitor is HDMI. 
HDMI spec tell us that any device containing IEEE Registration Identifier will 
be treated as HDMI device.
The patch intends to detect HDMI monitor by this rule.

Signed-off-by: Ma Ling ling...@intel.com
---
In this version the function will use edid info directly, instead of fetching 
it again,
at same time I did some clean-up,the patch need to re-base on [PATCH] drm: 
read EDID extensions from monitor(v2).
  
 drivers/gpu/drm/drm_edid.c |   62 
 include/drm/drm_crtc.h |1 +
 2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index a839a28..9b72fda 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -677,6 +677,68 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_get_edid);
 
+#define HDMI_IDENTIFIER 0x000C03
+#define VENDOR_BLOCK0x03
+/**
+ * drm_detect_hdmi_monitor - detect whether monitor is hdmi.
+ * @edid: monitor EDID information
+ *
+ * Parse the CEA extension according to CEA-861-B.
+ * Return true if HDMI, false if not or unknown.
+ */
+bool drm_detect_hdmi_monitor(struct edid *edid)
+{
+   char *edid_ext = NULL;
+   int i, hdmi_id, edid_ext_num;
+   int start_offset, end_offset;
+   bool is_hdmi = false;
+
+   /* No EDID or EDID extensions */
+   if (edid == NULL || edid-extensions == 0)
+   goto end;
+
+   /* Chose real EDID extension number */
+   edid_ext_num = edid-extensions  MAX_EDID_EXT_NUM ?
+  MAX_EDID_EXT_NUM : edid-extensions;
+
+   /* Find CEA extension */
+   for (i = 0; i  edid_ext_num; i++) {
+   edid_ext = (char *)edid + EDID_LENGTH * (i + 1);
+   /* This block is CEA extension */
+   if (edid_ext[0] == 0x02)
+   break;
+   }
+
+   if (i == edid_ext_num)
+   goto end;
+
+   /* Data block offset in CEA extension block */
+   start_offset = 4;
+   end_offset = edid_ext[2];
+
+   /*
+* Because HDMI identifier is in Vendor Specific Block,
+* search it from all data blocks of CEA extension.
+*/
+   for (i = start_offset; i  end_offset;
+   /* Increased by data block len */
+   i += ((edid_ext[i]  0x1f) + 1)) {
+   /* Find vendor specific block */
+   if ((edid_ext[i]  5) == VENDOR_BLOCK) {
+   hdmi_id = edid_ext[i + 1] | (edid_ext[i + 2]  8) |
+ edid_ext[i + 3]  16;
+   /* Find HDMI identifier */
+   if (hdmi_id == HDMI_IDENTIFIER)
+   is_hdmi = true;
+   break;
+   }
+   }
+
+end:
+   return is_hdmi;
+}
+EXPORT_SYMBOL(drm_detect_hdmi_monitor);
+
 /**
  * drm_add_edid_modes - add modes from EDID data, if available
  * @connector: connector we're probing
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 5ded1ac..2d81578 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -731,4 +731,5 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv);
 extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv);
+extern bool drm_detect_hdmi_monitor(struct edid *edid);
 #endif /* __DRM_CRTC_H__ */
-- 
1.5.4.4




--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12924] New: On GM965 KMS enabled kernel X does not draw untill mouse is moved. Probably IRQ problems.

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

   Summary: On GM965 KMS enabled kernel X does not draw untill mouse
is moved. Probably IRQ problems.
   Product: Drivers
   Version: 2.5
 KernelVersion: 2.6.29
  Platform: All
OS/Version: Linux
  Tree: Mainline
Status: NEW
  Severity: blocking
  Priority: P1
 Component: Video(DRI)
AssignedTo: drivers_video-...@kernel-bugs.osdl.org
ReportedBy: mateusz.ka...@gmail.com


Latest working kernel version: Every version with KMS disabled.
Earliest failing kernel version: Same problem with 2.6.29rc8
Distribution: GNU/Linux Debian Sid
Hardware Environment: 00:02.0 VGA compatible controller: Intel Corporation
Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)

Software Environment: Xorg(master) libdrm(master) xf86-intel(master)
mesa(master)
Problem Description: X does not draw elements unless mouse currsor is moved.
Moreover things are horribly slow.

Also after booting in KMS enabled mode.
 grep i915 /proc/interrupts 
 29:  1  0   PCI-MSI-edge  i915
After booting in KMS disabled mode.
 grep i915 /proc/interrupts 
 29:   5853   5411   PCI-MSI-edge  i...@pci::00:02.0

dmesg/syslog/Xorg.0.log does not produce any strange information so not
attached.

Steps to reproduce: Boot in KMS enabled kernel 2.6.29 on GM965 with software as
above and startx or gdm.


-- 
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.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12920] savage: mmap2 of /dev/dri/card0 fails with EAGAIN since 2.6.29-rc6

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





--- Comment #8 from mi...@elte.hu  2009-03-24 02:45 ---

testing latest -tip would be useful:

  http://people.redhat.com/mingo/tip.git/README

in particular the fix below has a chance of resolving it.

Ingo


From 9cdec049389ce2c324fd1ec508a71528a27d4a07 Mon Sep 17 00:00:00 2001
From: Pallipadi, Venkatesh venkatesh.pallip...@intel.com
Date: Mon, 23 Mar 2009 12:07:20 -0700
Subject: [PATCH] x86, PAT, PCI: Change vma prot in pci_mmap to reflect
inherited prot

While looking at the issue in the thread:

  http://marc.info/?l=dri-develm=123606627824556w=2

noticed a bug in pci PAT code and memory type setting.

PCI mmap code did not set the proper protection in vma, when it
inherited protection in reserve_memtype. This bug only affects
the case where there exists a WC mapping before X does an mmap
with /proc or /sys pci interface. This will cause X userlevel
mmap from /proc or /sysfs to fail on fork.

Reported-by: Kevin Winchester kjwinches...@gmail.com
Signed-off-by: Venkatesh Pallipadi venkatesh.pallip...@intel.com
Signed-off-by: Suresh Siddha suresh.b.sid...@intel.com
Cc: Jesse Barnes jbar...@virtuousgeek.org
Cc: Dave Airlie airl...@redhat.com
Cc: sta...@kernel.org
LKML-Reference: 20090323190720.ga16...@linux-os.sc.intel.com
Signed-off-by: Ingo Molnar mi...@elte.hu
---
 arch/x86/pci/i386.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 5ead808..f234a37 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -319,6 +319,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct
vm_area_struct *vma,
return -EINVAL;
}
flags = new_flags;
+   vma-vm_page_prot = __pgprot(
+   (pgprot_val(vma-vm_page_prot)  ~_PAGE_CACHE_MASK) |
+   flags);
}

if (((vma-vm_pgoff  max_low_pfn_mapped) ||


-- 
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.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 20537] piglit failures on ATI Mobility M6

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





--- Comment #5 from Michel Dänzer mic...@daenzer.net  2009-03-24 03:38:41 PST 
---
(In reply to comment #2)
 Any OpenGL application (well I tried two) only displays its first frame, and
 then freezes.

Can you run one of them in gdb and get a backtrace of a freeze? (You may need
to do this from a remote login, or you may not be able to interact with gdb
when the freeze happens)

Anyway, radeon-rewrite regressions should probably be tracked in a separate
report; does the current master branch still give the same failures?


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 6790] VIA Unichrome / Pro prolems

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


a...@lxorguk.ukuu.org.uk changed:

   What|Removed |Added

 CC||a...@lxorguk.ukuu.org.uk
 Status|NEW |REJECTED
 Resolution||INSUFFICIENT_DATA




--- Comment #19 from a...@lxorguk.ukuu.org.uk  2009-03-24 08:27 ---
Closing as stale


-- 
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.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12920] savage: mmap2 of /dev/dri/card0 fails with EAGAIN since 2.6.29-rc6

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





--- Comment #9 from a...@lxorguk.ukuu.org.uk  2009-03-24 10:57 ---
(pwc has a similar problem btw)


-- 
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.

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 2/2] agp/intel: use dma_alloc_coherent for special cursor memory

2009-03-24 Thread Jeremy Fitzhardinge
Impact: make i810 work under Xen

Given that i810 wants special physically contiguous memory for its
cursor, we should allocate it with dma_alloc_coherent, which will
give us memory with the right properties.  This is particularly for
Xen, which won't normally give us physically contiuous memory.

Signed-off-by: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com
Cc: David Airlie airl...@linux.ie

diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 4373adb..8ba6808 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -244,33 +244,29 @@ static void intel_i810_agp_enable(struct agp_bridge_data 
*bridge, u32 mode)
 /* Exists to support ARGB cursors */
 static void *i8xx_alloc_pages(void)
 {
-   struct page *page;
-
-   page = alloc_pages(GFP_KERNEL | GFP_DMA32, 2);
-   if (page == NULL)
+   void *addr;
+   dma_addr_t _d;
+   
+   addr = dma_alloc_coherent(NULL, 4 * PAGE_SIZE, _d, GFP_KERNEL);
+   if (addr == NULL)
return NULL;
 
-   if (set_pages_uc(page, 4)  0) {
-   set_pages_wb(page, 4);
-   __free_pages(page, 2);
+   if (set_memory_uc((unsigned long)addr, 4)  0) {
+   set_memory_wb((unsigned long)addr, 4);
+   dma_free_coherent(NULL, 4 * PAGE_SIZE, addr, _d);
return NULL;
}
-   get_page(page);
atomic_inc(agp_bridge-current_memory_agp);
-   return page_address(page);
+   return addr;
 }
 
 static void i8xx_destroy_pages(void *addr)
 {
-   struct page *page;
-
if (addr == NULL)
return;
 
-   page = virt_to_page(addr);
-   set_pages_wb(page, 4);
-   put_page(page);
-   __free_pages(page, 2);
+   set_memory_wb((unsigned long)addr, 4);
+   dma_free_coherent(NULL, 4 * PAGE_SIZE, addr, virt_to_bus(addr));
atomic_dec(agp_bridge-current_memory_agp);
 }
 



--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 1/2] agp: use more dma-ops-like operations for agp memory

2009-03-24 Thread Jeremy Fitzhardinge
Impact: make agp work under Xen

[ Hi Dave,  I was about to post this, but I'm not sure if you've had this
  explicitly brought to your attention for ack/nack.  Thanks -J ]

When using AGP under Xen, we need to be careful to
1) properly translate between physical and machine addresses, and
2) make sure memory is physically contigious when the hardware expects it

This change uses swiotlb_phys_to_bus/bus_to_phys to do the phys-gart
conversion, since they already do the right thing, and dma_alloc_coherent
for gatt allocations.  This works equally well running native.

Signed-off-by: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com
Cc: David Airlie airl...@linux.ie

diff --git a/arch/x86/include/asm/agp.h b/arch/x86/include/asm/agp.h
index 9825cd6..7ba2639 100644
--- a/arch/x86/include/asm/agp.h
+++ b/arch/x86/include/asm/agp.h
@@ -1,8 +1,11 @@
 #ifndef _ASM_X86_AGP_H
 #define _ASM_X86_AGP_H
 
+#include linux/swiotlb.h
+
 #include asm/pgtable.h
 #include asm/cacheflush.h
+#include asm/dma-mapping.h
 
 /*
  * Functions to keep the agpgart mappings coherent with the MMU. The
@@ -23,13 +26,15 @@
 #define flush_agp_cache() wbinvd()
 
 /* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
+#define phys_to_gart(x) swiotlb_phys_to_bus(NULL, (x))
+#define gart_to_phys(x) swiotlb_bus_to_phys(x)
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order)\
-   ((char *)__get_free_pages(GFP_KERNEL, (order)))
+#define alloc_gatt_pages(order)({  
\
+   char *_t; dma_addr_t _d;\
+   _t = dma_alloc_coherent(NULL,PAGE_SIZE(order),_d,GFP_KERNEL);\
+   _t; })
 #define free_gatt_pages(table, order)  \
-   free_pages((unsigned long)(table), (order))
+   dma_free_coherent(NULL,PAGE_SIZE(order),(table),virt_to_bus(table))
 
 #endif /* _ASM_X86_AGP_H */
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 8e6f6c8..98fb7d3 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -128,11 +128,13 @@ dma_addr_t __weak swiotlb_phys_to_bus(struct device 
*hwdev, phys_addr_t paddr)
 {
return paddr;
 }
+EXPORT_SYMBOL_GPL(swiotlb_phys_to_bus);
 
 phys_addr_t __weak swiotlb_bus_to_phys(dma_addr_t baddr)
 {
return baddr;
 }
+EXPORT_SYMBOL_GPL(swiotlb_bus_to_phys);
 
 static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
  volatile void *address)



--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 19002] RS690 break with multi-texture fragment programs

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





--- Comment #2 from Pierre Ossman drzeus-bugzi...@drzeus.cx  2009-03-24 
13:26:25 PST ---
I'm afraid I don't know as mplayer has been upgraded since this bug was filed.
I'm also no longer using that graphics card.

Feel free to close the bug if it's been proven to work on identical hardware. I
can always reopen it if I go back to my old card and still have problems. :)


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

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 19002] RS690 break with multi-texture fragment programs

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


Maciej Cencora m.cenc...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #3 from Maciej Cencora m.cenc...@gmail.com  2009-03-24 14:07:15 
PST ---
Ok, closing then.


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

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 9170] The r300 driver causes a SIGSEV while running nexuiz.

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


Maciej Cencora m.cenc...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #18 from Maciej Cencora m.cenc...@gmail.com  2009-03-24 18:14:51 
PST ---
It has been fixed long time ago and has proved to be working. Closing.


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

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel