[Bug 13683] Internal Laptopdisplay blurrys to white screen after enabling modesetting on Radeon X700 Mobility

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





--- Comment #18 from Jan Kreuzer kontrolla...@gmx.de  2009-11-03 08:38:21 ---
Created an attachment (id=23629)
 -- (http://bugzilla.kernel.org/attachment.cgi?id=23629)
radeontool notworking

Sorry for replying late, i was at an congress.

First Attachment ist radeontool regmatch '*' with whitescreen, second one is
after an vbetool dpms off / on cycle.

Thank you

Jan

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

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


[Bug 13683] Internal Laptopdisplay blurrys to white screen after enabling modesetting on Radeon X700 Mobility

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





--- Comment #19 from Jan Kreuzer kontrolla...@gmx.de  2009-11-03 08:39:03 ---
Created an attachment (id=23630)
 -- (http://bugzilla.kernel.org/attachment.cgi?id=23630)
radeontool working

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

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


[Bug 24397] Regression :[R6xx]: System hard hangs on starting X Server

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


samit vats hysv...@gmail.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED




--- Comment #9 from samit vats hysv...@gmail.com  2009-11-03 02:48:54 PST ---
(In reply to comment #8)
 Any chance you could bisect this?
 

Fixed in the latest build.


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

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


[Bug 24397] Regression :[R6xx]: System hard hangs on starting X Server

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


samit vats hysv...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED




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

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


RE: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness

2009-11-03 Thread BruceChang
Hello Sirs:
Request resend. Please be advised that the dual buffer/Security/Performance 
issue has been removed in this patch. So it is modified based on the comment 
you gave us on 10/8. Please kindly approve to integrate into mainline kernel.
Thanks and Best regards
=
Bruce C. Chang(張祖明)
VIA Technologies, Inc. 
Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
Tel: +886-2-22185452 Ext 7323
Mobile: +886-968343824
Fax: +886-2-22186282
Skype: Bruce.C.Chang
Email: brucech...@via.com.tw


-Original Message-
From: Bruce Chang 
Sent: Friday, October 30, 2009 2:04 PM
To: Thomas Hellstrom; 'Dave Airlie'
Cc: Joseph Chan; Benjamin Pan (Fremont); Harald Welte; 
dri-devel@lists.sourceforge.net
Subject: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness


Hello Sirs:
Based on the comment for my previous submission for VIA UniChrome DRM, we 
modify our code as the following patch. They are
1. Add support for ACPI suspend/resume issue.
2. Add an interfaces for communication with ddmpeg and v4l.
3. Fix video hang issue caused by verification function.
These patches are based on 2.6.32-rc5.
Please kindly help to check. And please kindly integrate it into mainline if 
it's OK.

Thanks and Best Regards
=
Bruce C. Chang(張祖明)
VIA Technologies, Inc. 
Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
Tel: +886-2-22185452 Ext 7323
Mobile: +886-968343824
Fax: +886-2-22186282
Skype: Bruce.C.Chang
Email: brucech...@via.com.tw
--
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 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] drm/radeon/kms/r700: fix some typos in chip init

2009-11-03 Thread Alex Deucher
From 70e8a6098f8debf71769f309bc3b25f2e1ce855d Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 3 Nov 2009 10:04:01 -0500
Subject: [PATCH] drm/radeon/kms/r700: fix some typos in chip init

Noticed by Andre on IRC.

Also fix up some minor whitespace issues.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/rv770.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 4055391..ae074fd 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -529,11 +529,11 @@ static void rv770_gpu_init(struct radeon_device *rdev)
if (rdev-family == CHIP_RV770)
gb_tiling_config |= BANK_TILING(1);
else
-   gb_tiling_config |= BANK_TILING((mc_arb_ramcfg  
NOOFBANK_SHIFT) 
NOOFBANK_MASK);
+   gb_tiling_config |= BANK_TILING((mc_arb_ramcfg  NOOFBANK_MASK) 

NOOFBANK_SHIFT);

gb_tiling_config |= GROUP_SIZE(0);

-   if (((mc_arb_ramcfg  NOOFROWS_MASK)  NOOFROWS_SHIFT)  3) {
+   if (((mc_arb_ramcfg  NOOFROWS_MASK)  NOOFROWS_SHIFT)  3) {
gb_tiling_config |= ROW_TILING(3);
gb_tiling_config |= SAMPLE_SPLIT(3);
} else {
@@ -579,14 +579,14 @@ static void rv770_gpu_init(struct radeon_device *rdev)

/* set HW defaults for 3D engine */
WREG32(CP_QUEUE_THRESHOLDS, (ROQ_IB1_START(0x16) |
-   ROQ_IB2_START(0x2b)));
+ROQ_IB2_START(0x2b)));

WREG32(CP_MEQ_THRESHOLDS, STQ_SPLIT(0x30));

WREG32(TA_CNTL_AUX, (DISABLE_CUBE_ANISO |
-   SYNC_GRADIENT |
-   SYNC_WALKER |
-   SYNC_ALIGNER));
+SYNC_GRADIENT |
+SYNC_WALKER |
+SYNC_ALIGNER));

sx_debug_1 = RREG32(SX_DEBUG_1);
sx_debug_1 |= ENABLE_NEW_SMX_ADDRESS;
@@ -598,9 +598,9 @@ static void rv770_gpu_init(struct radeon_device *rdev)
WREG32(SMX_DC_CTL0, smx_dc_ctl0);

WREG32(SMX_EVENT_CTL, (ES_FLUSH_CTL(4) |
- GS_FLUSH_CTL(4) |
- ACK_FLUSH_CTL(3) |
- SYNC_FLUSH_CTL));
+  GS_FLUSH_CTL(4) |
+  ACK_FLUSH_CTL(3) |
+  SYNC_FLUSH_CTL));

if (rdev-family == CHIP_RV770)
WREG32(DB_DEBUG3, DB_CLK_OFF_DELAY(0x1f));
@@ -611,12 +611,12 @@ static void rv770_gpu_init(struct radeon_device *rdev)
}

WREG32(SX_EXPORT_BUFFER_SIZES,
(COLOR_BUFFER_SIZE((rdev-config.rv770.sx_max_export_size / 4) - 1) |
-  
POSITION_BUFFER_SIZE((rdev-config.rv770.sx_max_export_pos_size
/ 4) - 1) |
-  
SMX_BUFFER_SIZE((rdev-config.rv770.sx_max_export_smx_size /
4) - 1)));
+   
POSITION_BUFFER_SIZE((rdev-config.rv770.sx_max_export_pos_size
/ 4) - 1) |
+   
SMX_BUFFER_SIZE((rdev-config.rv770.sx_max_export_smx_size / 4) - 1)));

WREG32(PA_SC_FIFO_SIZE,
(SC_PRIM_FIFO_SIZE(rdev-config.rv770.sc_prim_fifo_size) |
-
SC_HIZ_TILE_FIFO_SIZE(rdev-config.rv770.sc_hiz_tile_fifo_size) |
-
SC_EARLYZ_TILE_FIFO_SIZE(rdev-config.rv770.sc_earlyz_tile_fifo_fize)));
+
SC_HIZ_TILE_FIFO_SIZE(rdev-config.rv770.sc_hiz_tile_fifo_size) |
+
SC_EARLYZ_TILE_FIFO_SIZE(rdev-config.rv770.sc_earlyz_tile_fifo_fize)));

WREG32(PA_SC_MULTI_CHIP_CNTL, 0);

-- 
1.5.6.3
From 70e8a6098f8debf71769f309bc3b25f2e1ce855d Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 3 Nov 2009 10:04:01 -0500
Subject: [PATCH] drm/radeon/kms/r700: fix some typos in chip init

Noticed by Andre on IRC.

Also fix up some minor whitespace issues.

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/rv770.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 4055391..ae074fd 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -529,11 +529,11 @@ static void rv770_gpu_init(struct radeon_device *rdev)
 	if (rdev-family == CHIP_RV770)
 		gb_tiling_config |= BANK_TILING(1);
 	else
-		gb_tiling_config |= BANK_TILING((mc_arb_ramcfg  NOOFBANK_SHIFT)  NOOFBANK_MASK);
+		gb_tiling_config |= BANK_TILING((mc_arb_ramcfg  NOOFBANK_MASK)  NOOFBANK_SHIFT);
 
 	gb_tiling_config |= GROUP_SIZE(0);
 
-	if 

[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


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

2009-11-03 Thread James Simmons

 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) {
fb_dealloc_cmap(info-cmap);
   return -EINVAL;
}

Plug memory leak.


   } 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
 

--
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: replace DRM_COPY macro w/ a function

2009-11-03 Thread Andres Salomon
On Mon, 2 Nov 2009 23:41:24 -0800
Andrew Morton a...@linux-foundation.org wrote:

 On Mon, 19 Oct 2009 01:37:08 -0400 Andres Salomon
 dilin...@collabora.co.uk wrote:
 
  There are a few more macros in drmP.h that are unused;
  DRM_GET_PRIV_SAREA, DRM_ARRAY_SIZE, and DRM_WAITCOUNT can go away
  completely.
  
  Unfortunately, DRM_COPY is still used in one place, but we can at
  least move it to where it's used.  It's an awful looking macro..
 
 It would have been nice to fix the (valid) checkpatch warnings while
 you were there.
 

How about I do one better and replace the macro w/ a function?



From 535091717408e4ec4974e8f309212f61aabd1880 Mon Sep 17 00:00:00 2001
From: Andres Salomon dilin...@collabora.co.uk
Date: Tue, 3 Nov 2009 15:03:52 -0500
Subject: [PATCH] drm: replace DRM_COPY macro w/ a function

Don't inline it; the compiler can figure it out.  Comments added that are
based upon my interpretation of the code.  Hopefully they're correct. :)

Signed-off-by: Andres Salomon dilin...@collabora.co.uk
---
 drivers/gpu/drm/drm_drv.c |   34 ++
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 43297ca..ec0e3ae 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -368,14 +368,25 @@ module_exit(drm_core_exit);
 /**
  * Copy and IOCTL return string to user space
  */
-#define DRM_COPY(name, value) \
-   len = strlen(value);  \
-   if (len  name##_len) len = name##_len;   \
-   name##_len = strlen(value);   \
-   if (len  name) {\
-   if (copy_to_user(name, value, len))   \
-   return -EFAULT;   \
-   }
+static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
+{
+   int len;
+
+   /* don't overflow userbuf */
+   len = strlen(value);
+   if (len  *buf_len)
+   len = *buf_len;
+
+   /* let userspace know exact length of driver value (which could be
+* larger than the userspace-supplied buffer) */
+   *buf_len = strlen(value);
+
+   /* finally, try filling in the userbuf */
+   if (len  buf)
+   if (copy_to_user(buf, value, len))
+   return -EFAULT;
+   return 0;
+}
 
 /**
  * Get version information
@@ -392,14 +403,13 @@ static int drm_version(struct drm_device *dev, void *data,
   struct drm_file *file_priv)
 {
struct drm_version *version = data;
-   int len;
 
version-version_major = dev-driver-major;
version-version_minor = dev-driver-minor;
version-version_patchlevel = dev-driver-patchlevel;
-   DRM_COPY(version-name, dev-driver-name);
-   DRM_COPY(version-date, dev-driver-date);
-   DRM_COPY(version-desc, dev-driver-desc);
+   drm_copy_field(version-name, version-name_len, dev-driver-name);
+   drm_copy_field(version-date, version-date_len, dev-driver-date);
+   drm_copy_field(version-desc, version-desc_len, dev-driver-desc);
 
return 0;
 }
-- 
1.5.6.5





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


Re: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness

2009-11-03 Thread Thomas Hellstrom
Bruce,

I've been a bit short of time the last couple of weeks. I'll review as 
soon as time allows.

Thanks,
Thomas


brucech...@via.com.tw wrote:
 Hello Sirs:
 Request resend. Please be advised that the dual 
 buffer/Security/Performance issue has been removed in this patch. So it is 
 modified based on the comment you gave us on 10/8. Please kindly approve to 
 integrate into mainline kernel.
 Thanks and Best regards
 =
 Bruce C. Chang(張祖明)
 VIA Technologies, Inc. 
 Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
 Tel: +886-2-22185452 Ext 7323
 Mobile: +886-968343824
 Fax: +886-2-22186282
 Skype: Bruce.C.Chang
 Email: brucech...@via.com.tw


 -Original Message-
 From: Bruce Chang 
 Sent: Friday, October 30, 2009 2:04 PM
 To: Thomas Hellstrom; 'Dave Airlie'
 Cc: Joseph Chan; Benjamin Pan (Fremont); Harald Welte; 
 dri-devel@lists.sourceforge.net
 Subject: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness


 Hello Sirs:
 Based on the comment for my previous submission for VIA UniChrome DRM, we 
 modify our code as the following patch. They are
 1. Add support for ACPI suspend/resume issue.
 2. Add an interfaces for communication with ddmpeg and v4l.
 3. Fix video hang issue caused by verification function.
 These patches are based on 2.6.32-rc5.
 Please kindly help to check. And please kindly integrate it into mainline if 
 it's OK.

 Thanks and Best Regards
 =
 Bruce C. Chang(張祖明)
 VIA Technologies, Inc. 
 Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
 Tel: +886-2-22185452 Ext 7323
 Mobile: +886-968343824
 Fax: +886-2-22186282
 Skype: Bruce.C.Chang
 Email: brucech...@via.com.tw
   


--
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/radeon/kms: remove some misleading debugging output

2009-11-03 Thread Alex Deucher
From a98496560afee035314f35b08c59e5bcbfe096d7 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 3 Nov 2009 16:10:36 -0500
Subject: [PATCH] drm/radeon/kms: remove some misleading debugging output

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_bios.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_bios.c
b/drivers/gpu/drm/radeon/radeon_bios.c
index 34a9b91..9069217 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -50,19 +50,16 @@ static bool igp_read_bios_from_vram(struct
radeon_device *rdev)
vram_base = drm_get_resource_start(rdev-ddev, 0);
bios = ioremap(vram_base, size);
if (!bios) {
-   DRM_ERROR(Unable to mmap vram\n);
return false;
}

if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
iounmap(bios);
-   DRM_ERROR(bad rom signature\n);
return false;
}
rdev-bios = kmalloc(size, GFP_KERNEL);
if (rdev-bios == NULL) {
iounmap(bios);
-   DRM_ERROR(kmalloc failed\n);
return false;
}
memcpy(rdev-bios, bios, size);
-- 
1.5.6.3
From a98496560afee035314f35b08c59e5bcbfe096d7 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeuc...@gmail.com
Date: Tue, 3 Nov 2009 16:10:36 -0500
Subject: [PATCH] drm/radeon/kms: remove some misleading debugging output

Signed-off-by: Alex Deucher alexdeuc...@gmail.com
---
 drivers/gpu/drm/radeon/radeon_bios.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 34a9b91..9069217 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -50,19 +50,16 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
 	vram_base = drm_get_resource_start(rdev-ddev, 0);
 	bios = ioremap(vram_base, size);
 	if (!bios) {
-		DRM_ERROR(Unable to mmap vram\n);
 		return false;
 	}
 
 	if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
 		iounmap(bios);
-		DRM_ERROR(bad rom signature\n);
 		return false;
 	}
 	rdev-bios = kmalloc(size, GFP_KERNEL);
 	if (rdev-bios == NULL) {
 		iounmap(bios);
-		DRM_ERROR(kmalloc failed\n);
 		return false;
 	}
 	memcpy(rdev-bios, bios, size);
-- 
1.5.6.3

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


RE: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness

2009-11-03 Thread BruceChang
Hello Thomas:
Thank you very much for your help. Please kindly keep helping us.
 
Regards
 
=
Bruce C. Chang(張祖明)
VIA Technologies, Inc. 
Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
Tel: +886-2-22185452 Ext 7323
Fax: +886-2-22186282
Skype: Bruce.C.Chang
Email: brucech...@via.com.tw



From: Thomas Hellstrom [mailto:tho...@shipmail.org]
Sent: 2009/11/4 [星期三] 03:49
To: Bruce Chang
Cc: airl...@gmail.com; Joseph Chan; Benjamin Pan (Fremont); Harald Welte; 
dri-devel@lists.sourceforge.net
Subject: Re: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness



Bruce,

I've been a bit short of time the last couple of weeks. I'll review as
soon as time allows.

Thanks,
Thomas


brucech...@via.com.tw wrote:
 Hello Sirs:
 Request resend. Please be advised that the dual 
 buffer/Security/Performance issue has been removed in this patch. So it is 
 modified based on the comment you gave us on 10/8. Please kindly approve to 
 integrate into mainline kernel.
 Thanks and Best regards
 =
 Bruce C. Chang(張祖明)
 VIA Technologies, Inc.
 Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
 Tel: +886-2-22185452 Ext 7323
 Mobile: +886-968343824
 Fax: +886-2-22186282
 Skype: Bruce.C.Chang
 Email: brucech...@via.com.tw


 -Original Message-
 From: Bruce Chang
 Sent: Friday, October 30, 2009 2:04 PM
 To: Thomas Hellstrom; 'Dave Airlie'
 Cc: Joseph Chan; Benjamin Pan (Fremont); Harald Welte; 
 dri-devel@lists.sourceforge.net
 Subject: [Patch VIA UniChrome DRM][0/3 Ver2] Enhance DRM robustness


 Hello Sirs:
 Based on the comment for my previous submission for VIA UniChrome DRM, we 
 modify our code as the following patch. They are
 1. Add support for ACPI suspend/resume issue.
 2. Add an interfaces for communication with ddmpeg and v4l.
 3. Fix video hang issue caused by verification function.
 These patches are based on 2.6.32-rc5.
 Please kindly help to check. And please kindly integrate it into mainline if 
 it's OK.

 Thanks and Best Regards
 =
 Bruce C. Chang(張祖明)
 VIA Technologies, Inc.
 Address: 1F, 531, Chung-Cheng Road, Hsin-Tien, 231 Taipei
 Tel: +886-2-22185452 Ext 7323
 Mobile: +886-968343824
 Fax: +886-2-22186282
 Skype: Bruce.C.Chang
 Email: brucech...@via.com.tw
  



--
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: check return values in drm_version

2009-11-03 Thread Andres Salomon
On Tue, 3 Nov 2009 15:09:54 -0500
Andres Salomon dilin...@collabora.co.uk wrote:

 On Mon, 2 Nov 2009 23:41:24 -0800
 Andrew Morton a...@linux-foundation.org wrote:
 
  On Mon, 19 Oct 2009 01:37:08 -0400 Andres Salomon
  dilin...@collabora.co.uk wrote:
  
   There are a few more macros in drmP.h that are unused;
   DRM_GET_PRIV_SAREA, DRM_ARRAY_SIZE, and DRM_WAITCOUNT can go away
   completely.
   
   Unfortunately, DRM_COPY is still used in one place, but we can at
   least move it to where it's used.  It's an awful looking macro..
  
  It would have been nice to fix the (valid) checkpatch warnings while
  you were there.
  
 
 How about I do one better and replace the macro w/ a function?
 
 
 
 From 535091717408e4ec4974e8f309212f61aabd1880 Mon Sep 17 00:00:00 2001
 From: Andres Salomon dilin...@collabora.co.uk
 Date: Tue, 3 Nov 2009 15:03:52 -0500
 Subject: [PATCH] drm: replace DRM_COPY macro w/ a function
 
 Don't inline it; the compiler can figure it out.  Comments added that
 are based upon my interpretation of the code.  Hopefully they're
 correct. :)
 

And here's one that actually checks the return values from
drm_copy_field.  This is separate from the pure cleanup patch(es)
as it changes behavior that userspace
sees, so it can be bisected and reverted apart from the others if
needed.



From 041636a0e2b6d7ec5c4fdb8f495682d6928b73bf Mon Sep 17 00:00:00 2001
From: Andres Salomon dilin...@collabora.co.uk
Date: Tue, 3 Nov 2009 15:15:51 -0500
Subject: [PATCH] drm: check return values in drm_version

In drm_version, actually check the results from function calls so that
we're not potentially passing garbage back to userspace.

Signed-off-by: Andres Salomon dilin...@collabora.co.uk
---
 drivers/gpu/drm/drm_drv.c |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index ec0e3ae..5bd3f94 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -403,15 +403,21 @@ static int drm_version(struct drm_device *dev, void *data,
   struct drm_file *file_priv)
 {
struct drm_version *version = data;
+   int err;
 
version-version_major = dev-driver-major;
version-version_minor = dev-driver-minor;
version-version_patchlevel = dev-driver-patchlevel;
-   drm_copy_field(version-name, version-name_len, dev-driver-name);
-   drm_copy_field(version-date, version-date_len, dev-driver-date);
-   drm_copy_field(version-desc, version-desc_len, dev-driver-desc);
-
-   return 0;
+   err = drm_copy_field(version-name, version-name_len,
+   dev-driver-name);
+   if (!err)
+   err = drm_copy_field(version-date, version-date_len,
+   dev-driver-date);
+   if (!err)
+   err = drm_copy_field(version-desc, version-desc_len,
+   dev-driver-desc);
+
+   return err;
 }
 
 /**
-- 
1.5.6.5


--
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/radeon/kms: add irq mitigation code for sw interrupt.

2009-11-03 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

We really don't need to process every irq that comes in, we only
really want to do SW irq processing when we are actually waiting for
a fence to pass. I'm not 100% sure this is race free esp on non-MSI systems
so it needs some testing.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 drivers/gpu/drm/radeon/r100.c   |1 -
 drivers/gpu/drm/radeon/r300.c   |1 -
 drivers/gpu/drm/radeon/r420.c   |1 -
 drivers/gpu/drm/radeon/r520.c   |1 -
 drivers/gpu/drm/radeon/radeon.h |5 -
 drivers/gpu/drm/radeon/radeon_fence.c   |4 
 drivers/gpu/drm/radeon/radeon_irq_kms.c |   28 +++-
 drivers/gpu/drm/radeon/rs400.c  |1 -
 drivers/gpu/drm/radeon/rs600.c  |1 -
 drivers/gpu/drm/radeon/rs690.c  |1 -
 drivers/gpu/drm/radeon/rv515.c  |1 -
 11 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index b438b52..4f46d58 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3100,7 +3100,6 @@ static int r100_startup(struct radeon_device *rdev)
return r;
}
/* Enable IRQ */
-   rdev-irq.sw_int = true;
r100_irq_set(rdev);
/* 1M ring buffer */
r = r100_cp_init(rdev, 1024 * 1024);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 2f43ee8..0796df0 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1199,7 +1199,6 @@ static int r300_startup(struct radeon_device *rdev)
return r;
}
/* Enable IRQ */
-   rdev-irq.sw_int = true;
r100_irq_set(rdev);
/* 1M ring buffer */
r = r100_cp_init(rdev, 1024 * 1024);
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 5c7fe52..268a44b 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -186,7 +186,6 @@ static int r420_startup(struct radeon_device *rdev)
}
r420_pipes_init(rdev);
/* Enable IRQ */
-   rdev-irq.sw_int = true;
r100_irq_set(rdev);
/* 1M ring buffer */
r = r100_cp_init(rdev, 1024 * 1024);
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index a555b7b..44f36fb 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -185,7 +185,6 @@ static int r520_startup(struct radeon_device *rdev)
return r;
}
/* Enable IRQ */
-   rdev-irq.sw_int = true;
rs600_irq_set(rdev);
/* 1M ring buffer */
r = r100_cp_init(rdev, 1024 * 1024);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index ea3efd7..080d47e 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -348,11 +348,14 @@ struct radeon_irq {
boolsw_int;
/* FIXME: use a define max crtc rather than hardcode it */
boolcrtc_vblank_int[2];
+   spinlock_t sw_lock;
+   int sw_refcount;
 };
 
 int radeon_irq_kms_init(struct radeon_device *rdev);
 void radeon_irq_kms_fini(struct radeon_device *rdev);
-
+void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev);
+void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev);
 
 /*
  * CP  ring.
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
b/drivers/gpu/drm/radeon/radeon_fence.c
index 3beb26d..bfa6006 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -231,14 +231,18 @@ retry:
}
 
if (intr) {
+   radeon_irq_kms_sw_irq_get(rdev);
r = wait_event_interruptible_timeout(rdev-fence_drv.queue,
radeon_fence_signaled(fence), timeout);
+   radeon_irq_kms_sw_irq_put(rdev);
if (unlikely(r == -ERESTARTSYS)) {
return -EBUSY;
}
} else {
+   radeon_irq_kms_sw_irq_get(rdev);
r = wait_event_timeout(rdev-fence_drv.queue,
 radeon_fence_signaled(fence), timeout);
+   radeon_irq_kms_sw_irq_put(rdev);
}
if (unlikely(!radeon_fence_signaled(fence))) {
if (unlikely(r == 0)) {
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index a0fe623..94e1ad6 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -87,7 +87,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
 
if (rdev-flags  RADEON_SINGLE_CRTC)
num_crtc = 1;
-
+   spin_lock_init(rdev-irq.sw_lock);
r = drm_vblank_init(rdev-ddev, num_crtc);
if (r) {
return r;
@@ -114,3 +114,29 @@ void radeon_irq_kms_fini(struct radeon_device