Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-05 Thread Clemens Ladisch
Rafael J. Wysocki wrote:
 From: Clemens Ladisch clem...@ladisch.de
 Subject: PCI quirk: RS780/RS880: disable MSI completely
 
 The missing initialization of the nb_cntl.strap_msi_enable does not
 seem to be the only problem that prevents MSI, so that quirk is not
 sufficient to enable MSI on all machines.  To be safe, disable MSI
 unconditionally for the internal graphics and HDMI audio on these
 chipsets.
 
 [rjw: Added the PCI_VENDOR_ID_AI quirk.]
 ...
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AI, 0x9602, quirk_disable_msi);

I fear I have to NACK this.  The fact that two OEMs have changed the vendor
ID makes it likely that this is a bug in AMD's template BIOS code, and that
we will see the same problem on other systems using other vendor IDs.

So we should not use the vendor ID of device 0x9602 to declare the quirk, but
use some other device with an ID that is known to be correct.  We already
access the configuration space of the host bridge, so we should use that.

Furthermore, the quirk in my first patch was never run at all on the ALi
system, so it is probable that the nb_cntl.strap_msi_enable detection
would actually work.  Rafael, please test this patch; if it doesn't work
on your system, we can still remove the check for the strap_msi_enable bit.

==

Subject: PCI quirk: RS780/RS880: work around wrong vendor IDs of RS780 bridge

On many RS780 systems, the vendor ID of the PCI/PCI bridge for the
internal graphics is set to that of the mainboard vendor, so the quirk
would not match and failed to notice the disabled MSI.

Since we do not know in advance all possible vendor IDs, we have to
declare the quirk on another device with an ID that is known to be
correct, and use that as a stepping stone to find the PCI/PCI bridge,
if present.

Signed-off-by: Clemens Ladisch clem...@ladisch.de
Cc: sta...@kernel.org

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2483,34 +2483,38 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
  * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI audio
  * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit.
  */
-static void __init rs780_int_gfx_disable_msi(struct pci_dev *int_gfx_bridge)
+static void __init rs780_int_gfx_disable_msi(struct pci_dev *host_bridge)
 {
+   struct pci_dev *int_gfx_bridge;
u32 nb_cntl;
 
-   if (!int_gfx_bridge-subordinate)
+   /*
+* Many OEMs change the vendor ID of the internal graphics PCI/PCI
+* bridge, so we use the possible vendor/device IDs of the host bridge
+* for the declared quirk, and search for the PCI/PCI bridge by slot
+* number.
+*/
+   int_gfx_bridge = pci_get_slot(host_bridge-bus, PCI_DEVFN(1, 0));
+   if (!int_gfx_bridge)
return;
+   if (int_gfx_bridge-device != 0x9602 || !int_gfx_bridge-subordinate)
+   goto out;
 
-   pci_bus_write_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
-  0x60, 0);
-   pci_bus_read_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
- 0x64, nb_cntl);
+   pci_write_config_dword(host_bridge, 0x60, 0);
+   pci_read_config_dword(host_bridge, 0x64, nb_cntl);
 
if (!(nb_cntl  BIT(10))) {
dev_warn(int_gfx_bridge-dev,
 FW_WARN RS780: MSI for internal graphics disabled\n);
int_gfx_bridge-subordinate-bus_flags |= PCI_BUS_FLAGS_NO_MSI;
}
-}
 
-#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX0x9602
+out:
+   pci_dev_put(int_gfx_bridge);
+}
 
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,
-   PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
-   rs780_int_gfx_disable_msi);
-/* wrong vendor ID on M4A785TD motherboard: */
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK,
-   PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
-   rs780_int_gfx_disable_msi);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9600, rs780_int_gfx_disable_msi);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9601, rs780_int_gfx_disable_msi);
 
 #endif /* CONFIG_PCI_MSI */
 

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780

2010-04-02 Thread Clemens Ladisch
Linus Torvalds wrote:
 On Thu, 1 Apr 2010, Alex Deucher wrote:
  Clemems' PCI quirk: RS780/RS880: disable MSI completely patch is the
  right approach I think.  Note that it's only devices hung off the int
  gfx pci to pci bridge that have broken MSI (gfx and audio).  MSI works
  fine on the PCIE slots.  I have a similar patch for rs400 chips on bug
  15626:
  https://bugzilla.kernel.org/show_bug.cgi?id=15626
 
 Hmm. Does 'pci_msi_enable' only cover regular PCI devices? Or will that 
 pci_no_msi() quirk disable MSI for PCIE too?

A quirk that used pci_no_msi() would disable all MSI for all devices.
However, these patches (and that in bug 15626) use PCI_BUS_FLAGS_NO_MSI
so that only the internal GPU devices are affected.

That completely in my patch title should better read unconditionally.


Regards,
Clemens

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Regression, post-rc2] Commit a5ee4eb7541 breaks OpenGL on RS780 (was: Re: Linux 2.6.34-rc3)

2010-04-01 Thread Clemens Ladisch
Alex Deucher wrote:
 On Wed, Mar 31, 2010 at 9:13 PM, Rafael J. Wysocki r...@sisk.pl wrote:
 On Tuesday 30 March 2010, Rafael J. Wysocki wrote:
PCI quirk: RS780/RS880: work around missing MSI initialization

 This one (commit a5ee4eb7541) broke OpenGL acceleration on my new test box
 which happens to have a RS780.

So it's better to disable MSI unconditionally.

Rafael, can you check if MSI works for the HDMI audio device?
(I'd guess it doesn't.)

 I also have the attached patch queued in via Dave's tree to disable
 MSI on all IGP chips for the time being.

This disables MSI only for the graphics device.  I'd prefer to have
the quirk on its bridge so that MSI gets disabled for the HDMI audio
device too, to avoid having to duplicate this quirk in the snd-hda-intel
driver.

==

PCI quirk: RS780/RS880: disable MSI completely

The missing initialization of the nb_cntl.strap_msi_enable does not seem
to be the only problem that prevents MSI, so that quirk is not
sufficient to enable MSI on all machines.  To be safe, unconditionally
disable MSI for the internal graphics and HDMI audio on these chipsets.

Signed-off-by: Clemens Ladisch clem...@ladisch.de

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2123,6 +2123,8 @@ static void __devinit quirk_disable_msi(struct pci_dev 
*dev)
}
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, 
quirk_disable_msi);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
 
 /* Go through the list of Hypertransport capabilities and
@@ -2495,39 +2497,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4374,
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
quirk_msi_intx_disable_bug);
 
-/*
- * MSI does not work with the AMD RS780/RS880 internal graphics and HDMI audio
- * devices unless the BIOS has initialized the nb_cntl.strap_msi_enable bit.
- */
-static void __init rs780_int_gfx_disable_msi(struct pci_dev *int_gfx_bridge)
-{
-   u32 nb_cntl;
-
-   if (!int_gfx_bridge-subordinate)
-   return;
-
-   pci_bus_write_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
-  0x60, 0);
-   pci_bus_read_config_dword(int_gfx_bridge-bus, PCI_DEVFN(0, 0),
- 0x64, nb_cntl);
-
-   if (!(nb_cntl  BIT(10))) {
-   dev_warn(int_gfx_bridge-dev,
-FW_WARN RS780: MSI for internal graphics disabled\n);
-   int_gfx_bridge-subordinate-bus_flags |= PCI_BUS_FLAGS_NO_MSI;
-   }
-}
-
-#define PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX0x9602
-
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,
-   PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
-   rs780_int_gfx_disable_msi);
-/* wrong vendor ID on M4A785TD motherboard: */
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK,
-   PCI_DEVICE_ID_AMD_RS780_P2P_INT_GFX,
-   rs780_int_gfx_disable_msi);
-
 #endif /* CONFIG_PCI_MSI */
 
 #ifdef CONFIG_PCI_IOV

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/kms: fix spelling of CLOCK

2010-01-19 Thread Clemens Ladisch
From: Pavel Roskin pro...@gnu.org

Signed-off-by: Pavel Roskin pro...@gnu.org
[clem...@ladisch.de: merged into drm_fb_helper]
Signed-off-by: Clemens Ladisch clem...@ladisch.de

--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -694,7 +694,7 @@ int drm_fb_helper_set_par(struct fb_info
int i;
 
if (var-pixclock != 0) {
-   DRM_ERROR(PIXEL CLCOK SET\n);
+   DRM_ERROR(PIXEL CLOCK SET\n);
return -EINVAL;
}
 

--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [Linux-fbdev-devel] drm_fb_helper: Impossible to change video mode

2009-11-20 Thread Clemens Ladisch
Paulius Zaleckas wrote:
 On drivers using drm_fb_helper's in fb_ops it is not possible to change
 video mode, because of different var-pixclock evaluation: ...

patch:
http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg44369.html

 P.S. check CLCOK spelling :)

This patch got lost during fb helper reorganization:
http://git.kernel.org/linus/1bcbf3948876e31a8ece28597dec447611ad9c8b


Regards,
Clemens

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v3 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling

2009-11-04 Thread Clemens Ladisch
When the framebuffer driver does not publish detailed timing information
for the current video mode, the correct value for the pixclock field is
zero, not -1.

Since pixclock is actually unsigned, the value -1 would be interpreted
as 4294967295 picoseconds (i.e., about 4 milliseconds) by
register_framebuffer() and userspace programs.

This patch allows X.org's fbdev driver to work.

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
No changes from v1.

 drivers/gpu/drm/drm_fb_helper.c |   6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -599,7 +599,7 @@ int drm_fb_helper_check_var(struct fb_va
struct drm_framebuffer *fb = fb_helper-fb;
int depth;
 
-   if (var-pixclock == -1 || !var-pixclock)
+   if (var-pixclock != 0)
return -EINVAL;
 
/* Need to resize the fb object !!! */
@@ -691,7 +691,7 @@ int drm_fb_helper_set_par(struct fb_info
int ret;
int i;
 
-   if (var-pixclock != -1) {
+   if (var-pixclock != 0) {
DRM_ERROR(PIXEL CLCOK SET\n);
return -EINVAL;
}
@@ -904,7 +904,7 @@ int drm_fb_helper_single_fb_probe(struct
fb_helper-fb = fb;
 
if (new_fb) {
-   info-var.pixclock = -1;
+   info-var.pixclock = 0;
if (register_framebuffer(info)  0)
return -EINVAL;
} else {


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v3 2/3] drm: set the type of the drm_framebuffer::fbdev field

2009-11-04 Thread Clemens Ladisch
The fbdev field of the drm_framebuffer structure is always used to store
a pointer to a fb_info, so there is no reason for it to be void*.

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
Needed for the next patch; no changes from v2.

 include/drm/drm_crtc.h  |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6/include/drm/drm_crtc.h
+++ linux-2.6/include/drm/drm_crtc.h
@@ -256,7 +256,7 @@ struct drm_framebuffer {
unsigned int depth;
int bits_per_pixel;
int flags;
-   void *fbdev;
+   struct fb_info *fbdev;
u32 pseudo_palette[17];
struct list_head filp_head;
/* if you are using the helper */


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v3 0/3] DRM/KMS framebuffer fixes

2009-11-04 Thread Clemens Ladisch
James Simmons wrote:
  @@ -905,6 +905,9 @@ int drm_fb_helper_single_fb_probe(struct
   
  if (new_fb) {
  info-var.pixclock = 0;
  +   ret = fb_alloc_cmap(info-cmap, crtc-gamma_size, 0);
  +   if (ret)
  +   return ret;
 
  if (register_framebuffer(info)  0) {
   fb_dealloc_cmap(info-cmap);
  return -EINVAL;
   }
 
 Plug memory leak.

Oops.  Thanks again.
New patch set follows:

 include/drm/drm_crtc.h  |2 +-
 drivers/gpu/drm/drm_fb_helper.c |   14 ++
 2 files changed, 11 insertions(+), 5 deletions(-)

v2: incorporated suggestions by James Simmons
v3: bugfix by James Simmons

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v3 3/3] drm/kms: allocate framebuffer cmap

2009-11-04 Thread Clemens Ladisch
Without an allocated colormap, FBIOGETCMAP fails.  This would make
programs restore an all-black colormap (links -g) or fail to work
altogether (mplayer -vo fbdev2).

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
v3: bugfix by James Simmons

 drivers/gpu/drm/drm_fb_helper.c |   7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -905,8 +905,13 @@ int drm_fb_helper_single_fb_probe(struct
 
if (new_fb) {
info-var.pixclock = 0;
-   if (register_framebuffer(info)  0)
+   ret = fb_alloc_cmap(info-cmap, crtc-gamma_size, 0);
+   if (ret)
+   return ret;
+   if (register_framebuffer(info)  0) {
+   fb_dealloc_cmap(info-cmap);
return -EINVAL;
+   }
} else {
drm_fb_helper_set_par(info);
}
@@ -936,6 +941,7 @@ void drm_fb_helper_free(struct drm_fb_he
unregister_sysrq_key('v', sysrq_drm_fb_helper_restore_op);
}
drm_fb_helper_crtc_free(helper);
+   fb_dealloc_cmap(helper-fb-fbdev-cmap);
 }
 EXPORT_SYMBOL(drm_fb_helper_free);
 


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v2 0/3] DRM/KMS framebuffer fixes

2009-11-03 Thread Clemens Ladisch
James Simmons wrote:
 Without an allocated colormap, FBIOGETCMAP fails.  This would make
 programs restore an all-black colormap (links -g) or fail to work
 altogether (mplayer -vo fbdev2).
 
 --- linux-2.6/drivers/gpu/drm/i915/intel_fb.c
 +++ linux-2.6/drivers/gpu/drm/i915/intel_fb.c
 @@ -227,6 +227,10 @@ static int intelfb_create(struct drm_dev
  
  fb-fbdev = info;
  
 +ret = fb_alloc_cmap(info-cmap, 256, 0);
 +if (ret)
 +goto out_unpin;
 +
  par-intel_fb = intel_fb;
 
 It would be better to place that code in drm_fb_helper_single_fb_probe.

Thanks, I wasn't quite able to untangle the indirections between the
four framebuffer structures.

New patch set follows.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v2 2/3] drm: set the type of the drm_framebuffer::fbdev field

2009-11-03 Thread Clemens Ladisch
The fbdev field of the drm_framebuffer structure is always used to store
a pointer to a fb_info, so there is no reason for it to be void*.

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
Needed for the next patch.

 include/drm/drm_crtc.h  |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6/include/drm/drm_crtc.h
+++ linux-2.6/include/drm/drm_crtc.h
@@ -256,7 +256,7 @@ struct drm_framebuffer {
unsigned int depth;
int bits_per_pixel;
int flags;
-   void *fbdev;
+   struct fb_info *fbdev;
u32 pseudo_palette[17];
struct list_head filp_head;
/* if you are using the helper */


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v2 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling

2009-11-03 Thread Clemens Ladisch
When the framebuffer driver does not publish detailed timing information
for the current video mode, the correct value for the pixclock field is
zero, not -1.

Since pixclock is actually unsigned, the value -1 would be interpreted
as 4294967295 picoseconds (i.e., about 4 milliseconds) by
register_framebuffer() and userspace programs.

This patch allows X.org's fbdev driver to work.

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
No changes from v1.

 drivers/gpu/drm/drm_fb_helper.c |   6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -599,7 +599,7 @@ int drm_fb_helper_check_var(struct fb_va
struct drm_framebuffer *fb = fb_helper-fb;
int depth;
 
-   if (var-pixclock == -1 || !var-pixclock)
+   if (var-pixclock != 0)
return -EINVAL;
 
/* Need to resize the fb object !!! */
@@ -691,7 +691,7 @@ int drm_fb_helper_set_par(struct fb_info
int ret;
int i;
 
-   if (var-pixclock != -1) {
+   if (var-pixclock != 0) {
DRM_ERROR(PIXEL CLCOK SET\n);
return -EINVAL;
}
@@ -904,7 +904,7 @@ int drm_fb_helper_single_fb_probe(struct
fb_helper-fb = fb;
 
if (new_fb) {
-   info-var.pixclock = -1;
+   info-var.pixclock = 0;
if (register_framebuffer(info)  0)
return -EINVAL;
} else {


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH v2 3/3] drm/kms: allocate framebuffer cmap

2009-11-03 Thread Clemens Ladisch
Without an allocated colormap, FBIOGETCMAP fails.  This would make
programs restore an all-black colormap (links -g) or fail to work
altogether (mplayer -vo fbdev2).

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
v2: implemented suggestions by James Simmons

 drivers/gpu/drm/drm_fb_helper.c |   4 
 1 file changed, 4 insertions(+)

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -905,6 +905,9 @@ int drm_fb_helper_single_fb_probe(struct
 
if (new_fb) {
info-var.pixclock = 0;
+   ret = fb_alloc_cmap(info-cmap, crtc-gamma_size, 0);
+   if (ret)
+   return ret;
if (register_framebuffer(info)  0)
return -EINVAL;
} else {
@@ -936,6 +939,7 @@ void drm_fb_helper_free(struct drm_fb_he
unregister_sysrq_key('v', sysrq_drm_fb_helper_restore_op);
}
drm_fb_helper_crtc_free(helper);
+   fb_dealloc_cmap(helper-fb-fbdev-cmap);
 }
 EXPORT_SYMBOL(drm_fb_helper_free);
 


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 0/3] DRM/KMS framebuffer fixes

2009-11-02 Thread Clemens Ladisch
These patches make the KMS framebuffer work with various programs like
links, mplayer and X.

 drivers/gpu/drm/drm_fb_helper.c|6 +++---
 drivers/gpu/drm/i915/intel_fb.c|5 +
 drivers/gpu/drm/radeon/radeon_fb.c |5 +
 3 files changed, 13 insertions(+), 3 deletions(-)

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 1/3] drm/fb: fix FBIOGET/PUT_VSCREENINFO pixel clock handling

2009-11-02 Thread Clemens Ladisch
When the framebuffer driver does not publish detailed timing information
for the current video mode, the correct value for the pixclock field is
zero, not -1.

Since pixclock is actually unsigned, the value -1 would be interpreted
as 4294967295 picoseconds (i.e., about 4 milliseconds) by
register_framebuffer() and userspace programs.

This patch allows X.org's fbdev driver to work.

Signed-off-by: Clemens Ladisch clem...@ladisch.de

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -583,7 +583,7 @@ int drm_fb_helper_check_var(struct fb_va
struct drm_framebuffer *fb = fb_helper-fb;
int depth;
 
-   if (var-pixclock == -1 || !var-pixclock)
+   if (var-pixclock != 0)
return -EINVAL;
 
/* Need to resize the fb object !!! */
@@ -675,7 +675,7 @@ int drm_fb_helper_set_par(struct fb_info
int ret;
int i;
 
-   if (var-pixclock != -1) {
+   if (var-pixclock != 0) {
DRM_ERROR(PIXEL CLCOK SET\n);
return -EINVAL;
}
@@ -888,7 +888,7 @@ int drm_fb_helper_single_fb_probe(struct
fb_helper-fb = fb;
 
if (new_fb) {
-   info-var.pixclock = -1;
+   info-var.pixclock = 0;
if (register_framebuffer(info)  0)
return -EINVAL;
} else {

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/kms: fix spelling of CLOCK

2009-11-02 Thread Clemens Ladisch
From: Pavel Roskin pro...@gnu.org
Signed-off-by: Pavel Roskin pro...@gnu.org
[clem...@ladisch.de: merged into drm_fb_helper]
Signed-off-by: Clemens Ladisch clem...@ladisch.de

--- linux-2.6/drivers/gpu/drm/drm_fb_helper.c
+++ linux-2.6/drivers/gpu/drm/drm_fb_helper.c
@@ -676,7 +676,7 @@ int drm_fb_helper_set_par(struct fb_info
int i;
 
if (var-pixclock != 0) {
-   DRM_ERROR(PIXEL CLCOK SET\n);
+   DRM_ERROR(PIXEL CLOCK SET\n);
return -EINVAL;
}
 

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 3/3] drm/i915: allocate framebuffer cmap

2009-11-02 Thread Clemens Ladisch
Without an allocated colormap, FBIOGETCMAP fails.  This would make
programs restore an all-black colormap (links -g) or fail to work
altogether (mplayer -vo fbdev2).

Signed-off-by: Clemens Ladisch clem...@ladisch.de
---
Untested.

--- linux-2.6/drivers/gpu/drm/i915/intel_fb.c
+++ linux-2.6/drivers/gpu/drm/i915/intel_fb.c
@@ -227,6 +227,10 @@ static int intelfb_create(struct drm_dev
 
fb-fbdev = info;
 
+   ret = fb_alloc_cmap(info-cmap, 256, 0);
+   if (ret)
+   goto out_unpin;
+
par-intel_fb = intel_fb;
 
/* To allow resizeing without swapping buffers */
@@ -270,6 +274,7 @@ int intelfb_remove(struct drm_device *de
iounmap(info-screen_base);
if (info-par)
drm_fb_helper_free(par-helper);
+   fb_dealloc_cmap(info-cmap);
framebuffer_release(info);
}
 


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 2/3] drm/radeon/kms: allocate framebuffer cmap

2009-11-02 Thread Clemens Ladisch
Without an allocated colormap, FBIOGETCMAP fails.  This would make
programs restore an all-black colormap (links -g) or fail to work
altogether (mplayer -vo fbdev2).

Signed-off-by: Clemens Ladisch clem...@ladisch.de

--- linux-2.6/drivers/gpu/drm/radeon/radeon_fb.c
+++ linux-2.6/drivers/gpu/drm/radeon/radeon_fb.c
@@ -242,6 +242,10 @@ int radeonfb_create(struct drm_device *d
goto out_unref;
}
 
+   ret = fb_alloc_cmap(info-cmap, 256, 0);
+   if (ret)
+   goto out_unref;
+
memset_io(fbptr, 0, aligned_size);
 
strcpy(info-fix.id, radeondrmfb);
@@ -341,6 +345,7 @@ int radeonfb_remove(struct drm_device *d
radeon_object_kunmap(robj);
radeon_object_unpin(robj);
drm_fb_helper_free(rfbdev-helper);
+   fb_dealloc_cmap(info-cmap);
framebuffer_release(info);
}
 


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel