[Fwd: May I be of some assistance?]

2007-08-27 Thread Michel Dänzer

Accidentally discarded this as spam based on the subject...


-- 
Earthling Michel Dänzer   |  http://tungstengraphics.com
Libre software enthusiast |  Debian, X and DRI developer
--- Begin Message ---
Hey all,

Apologies if this is the wrong place... Point me in the right direction if
so... Thanks!

I have a ATI Technologies Inc Radeon XPRESS 200M 5955 (PCIE)
.
. (I know, I know)
.
I would like to get all that Compiz goodness working on it.
I can code in C - I have read http://dri.freedesktop.org/wiki/Radeon200M but
it
resembles Albanian in its familiarity to me (no offence Albania!). If
somebody
could tell me how I can go about tracing and decoding accesses and how to
inspect what is happening in the current fglrx 8.40.4 driver I would be more
than
willing (this is the last piece of hardware not to work fully on my Compaq
R4100 -
even the broadcom wireless now works... shock, horror!)

As I say - I can code in C, I know a bit about x86 assembler and understand
about hardware I/O and stuff - I'm not up to date on 3d acceleration and
stuff but
if I was I'd be working for ATI, Nvidia or Intel then wouldn't I? Or maybe
not.

Thanks in advance for the heads-up, I've been meaning to offer a helping
hand for about a year now - I hope that I may be of some help in some way,
Anthony
--- End Message ---
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12193] segment fault when call glBitmap if DrawBuffer mode is GL_LEFT

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=12193





--- Comment #1 from [EMAIL PROTECTED]  2007-08-27 23:43 PST ---
Created an attachment (id=11304)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=11304&action=view)
test case


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12193] New: segment fault when call glBitmap if DrawBuffer mode is GL_LEFT

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=12193

   Summary: segment fault when call glBitmap if DrawBuffer mode is
GL_LEFT
   Product: Mesa
   Version: CVS
  Platform: x86 (IA32)
OS/Version: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/DRI/i965
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: dri-devel@lists.sourceforge.net


If specify DrawBuffer mode to GL_LEFT, then call glBitmap, segment fault will
occur. Below is the backtrace info:

(gdb) bt
#0  0x2b499c0e4a11 in intelBitmap (ctx=0x610f70, x=, 
y=, width=, 
height=, unpack=0x61d450, 
pixels=0x7fff0fd67100 '�' ...)
at intel_pixel_bitmap.c:282
#1  0x2b499c22bbcf in _mesa_Bitmap (width=8, height=8, xorig=0, yorig=0, 
xmove=0, ymove=0, bitmap=0x7fff0fd67100 '�' ...)
at main/drawpix.c:348
#2  0x2b499ad9adb3 in glBitmap (width=8, height=8, xorig=0, yorig=0, 
xmove=0, ymove=0, bitmap=0x7fff0fd67100 '�' ...)
at ../../../src/mesa/glapi/glapitemp.h:125
#3  0x00400f7f in test () at drawbuffer_bitmap.c:57
#4  0x00401084 in display () at drawbuffer_bitmap.c:80


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 16/23] i915_mem.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/i915_mem.c | 9842 -> 9808 (-34 bytes)
 drivers/char/drm/i915_mem.o | 114556 -> 114464 (-92 bytes)

 drivers/char/drm/i915_mem.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/i915_mem.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/i915_mem.c
@@ -189,7 +189,7 @@ static int init_heap(struct mem_block **
if (!blocks)
return -ENOMEM;

-   *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFLISTS);
+   *heap = drm_zalloc(sizeof(**heap), DRM_MEM_BUFLISTS);
if (!*heap) {
drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFLISTS);
return -ENOMEM;
@@ -200,7 +200,6 @@ static int init_heap(struct mem_block **
blocks->filp = NULL;
blocks->next = blocks->prev = *heap;

-   memset(*heap, 0, sizeof(**heap));
(*heap)->filp = (DRMFILE) - 1;
(*heap)->next = (*heap)->prev = blocks;
return 0;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 19/23] radeon_cp.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/radeon_cp.c | 62519 -> 62461 (-58 bytes)
 drivers/char/drm/radeon_cp.o | 160564 -> 160596 (+32 bytes)

 drivers/char/drm/radeon_cp.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/radeon_cp.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/radeon_cp.c
@@ -2239,11 +2239,10 @@ int radeon_driver_load(struct drm_device
drm_radeon_private_t *dev_priv;
int ret = 0;

-   dev_priv = drm_alloc(sizeof(drm_radeon_private_t), DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   dev_priv = drm_zalloc(sizeof(drm_radeon_private_t), DRM_MEM_DRIVER);
+   if (!dev_priv)
return DRM_ERR(ENOMEM);

-   memset(dev_priv, 0, sizeof(drm_radeon_private_t));
dev->dev_private = (void *)dev_priv;
dev_priv->flags = flags;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 21/23] savage_bci.c: drm_alloc + memset to drm_zalloc and cleanup

2007-08-27 Thread m . kozlowski
The initialization in for loop can be removed as the SET_AGE macro
set the age struct and other members to zero.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/savage_bci.c | 31888 -> 31634 (-254 bytes)
 drivers/char/drm/savage_bci.o | 138936 -> 138984 (+48 bytes)

 drivers/char/drm/savage_bci.c |   18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/savage_bci.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/savage_bci.c
@@ -294,20 +294,13 @@ void savage_freelist_put(struct drm_devi
  */
 static int savage_dma_init(drm_savage_private_t * dev_priv)
 {
-   unsigned int i;
-
dev_priv->nr_dma_pages = dev_priv->cmd_dma->size /
(SAVAGE_DMA_PAGE_SIZE * 4);
-   dev_priv->dma_pages = drm_alloc(sizeof(drm_savage_dma_page_t) *
-   dev_priv->nr_dma_pages, DRM_MEM_DRIVER);
-   if (dev_priv->dma_pages == NULL)
+   dev_priv->dma_pages = drm_calloc(dev_priv->nr_dma_pages,
+   sizeof(drm_savage_dma_page_t), DRM_MEM_DRIVER);
+   if (!dev_priv->dma_pages)
return DRM_ERR(ENOMEM);

-   for (i = 0; i < dev_priv->nr_dma_pages; ++i) {
-   SET_AGE(&dev_priv->dma_pages[i].age, 0, 0);
-   dev_priv->dma_pages[i].used = 0;
-   dev_priv->dma_pages[i].flushed = 0;
-   }
SET_AGE(&dev_priv->last_dma_age, 0, 0);

dev_priv->first_dma_page = 0;
@@ -539,11 +532,10 @@ int savage_driver_load(struct drm_device
 {
drm_savage_private_t *dev_priv;

-   dev_priv = drm_alloc(sizeof(drm_savage_private_t), DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   dev_priv = drm_zalloc(sizeof(drm_savage_private_t), DRM_MEM_DRIVER);
+   if (!dev_priv)
return DRM_ERR(ENOMEM);

-   memset(dev_priv, 0, sizeof(drm_savage_private_t));
dev->dev_private = (void *)dev_priv;

dev_priv->chipset = (enum savage_family)chipset;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 12/23] i810_dma.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/i810_dma.c | 37542 -> 37480 (-62 bytes)
 drivers/char/drm/i810_dma.o | 150664 -> 149996 (-668 bytes)

 drivers/char/drm/i810_dma.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/i810_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/i810_dma.c
@@ -328,7 +328,6 @@ static int i810_dma_initialize(struct dr
   drm_i810_init_t * init)
 {
struct drm_map_list *r_list;
-   memset(dev_priv, 0, sizeof(drm_i810_private_t));

list_for_each_entry(r_list, &dev->maplist, head) {
if (r_list->map &&
@@ -498,9 +497,9 @@ static int i810_dma_init(struct inode *i
if (retcode)
return retcode;

-   dev_priv = drm_alloc(sizeof(drm_i810_private_t),
+   dev_priv = drm_zalloc(sizeof(drm_i810_private_t),
 DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   if (!dev_priv)
return -ENOMEM;
retcode = i810_dma_initialize(dev, dev_priv, &init);
break;
@@ -512,9 +511,9 @@ static int i810_dma_init(struct inode *i
   sizeof(drm_i810_init_t))) {
return -EFAULT;
}
-   dev_priv = drm_alloc(sizeof(drm_i810_private_t),
+   dev_priv = drm_zalloc(sizeof(drm_i810_private_t),
 DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   if (!dev_priv)
return -ENOMEM;
retcode = i810_dma_initialize(dev, dev_priv, &init);
break;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH 01/23] introduce drm_zalloc as a drm_alloc + memset replacement

2007-08-27 Thread Mariusz Kozlowski
> Add drm_zalloc().

Ugh. Too fast. Ofcourse this is the correct version. Sorry.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

--- linux-2.6.23-rc3-mm1-a/drivers/char/drm/drmP.h  2007-08-27 
18:32:26.0 +0200
+++ linux-2.6.23-rc3-mm1-b/drivers/char/drm/drmP.h  2007-08-26 
15:34:40.0 +0200
@@ -1125,10 +1125,17 @@ static __inline__ void *drm_calloc(size_
 {
return kcalloc(nmemb, size, GFP_KERNEL);
 }
+
+/** Wrapper around kzalloc() */
+static __inline__ void *drm_zalloc(size_t size, int area)
+{
+   return kzalloc(size, GFP_KERNEL);
+}
 #else
 extern void *drm_alloc(size_t size, int area);
 extern void drm_free(void *pt, size_t size, int area);
 extern void *drm_calloc(size_t nmemb, size_t size, int area);
+extern void *drm_zalloc(size_t size, int area);
 #endif

 /[EMAIL PROTECTED]/
--- linux-2.6.23-rc3-mm1-a/drivers/char/drm/drm_memory_debug.h  2007-08-27 
18:32:26.0 +0200
+++ linux-2.6.23-rc3-mm1-b/drivers/char/drm/drm_memory_debug.h  2007-08-27 
23:28:31.0 +0200
@@ -167,13 +167,24 @@ void *drm_alloc (size_t size, int area)
 void *drm_calloc (size_t nmemb, size_t size, int area) {
void *addr;

-   addr = drm_alloc (nmemb * size, area);
-   if (addr != NULL)
-   memset((void *)addr, 0, size * nmemb);
+   addr = drm_alloc(nmemb * size, area);
+   if (addr)
+   memset(addr, 0, size * nmemb);

return addr;
 }

+void *drm_zalloc(size_t size, int area)
+{
+   void *addr;
+
+   addr = drm_alloc(size, area);
+   if (addr)
+   memset(addr, 0, size);
+
+   return addr;
+}
+
 void *drm_realloc (void *oldpt, size_t oldsize, size_t size, int area) {
void *pt;


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 22/23] sis_drv.c: drm_calloc to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/sis_drv.c | 3249 -> 3239 (-10 bytes)
 drivers/char/drm/sis_drv.o | 104756 -> 105460 (+704 bytes)

 drivers/char/drm/sis_drv.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/sis_drv.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/sis_drv.c
@@ -40,8 +40,8 @@ static int sis_driver_load(struct drm_de
drm_sis_private_t *dev_priv;
int ret;

-   dev_priv = drm_calloc(1, sizeof(drm_sis_private_t), DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   dev_priv = drm_zalloc(sizeof(drm_sis_private_t), DRM_MEM_DRIVER);
+   if (!dev_priv)
return DRM_ERR(ENOMEM);

dev->dev_private = (void *)dev_priv;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 20/23] radeon_mem.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/radeon_mem.c | 7711 -> 7677 (-34 bytes)
 drivers/char/drm/radeon_mem.o | 115484 -> 115396 (-88 bytes)

 drivers/char/drm/radeon_mem.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/radeon_mem.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/radeon_mem.c
@@ -139,7 +139,7 @@ static int init_heap(struct mem_block **
if (!blocks)
return DRM_ERR(ENOMEM);

-   *heap = drm_alloc(sizeof(**heap), DRM_MEM_BUFS);
+   *heap = drm_zalloc(sizeof(**heap), DRM_MEM_BUFS);
if (!*heap) {
drm_free(blocks, sizeof(*blocks), DRM_MEM_BUFS);
return DRM_ERR(ENOMEM);
@@ -150,7 +150,6 @@ static int init_heap(struct mem_block **
blocks->filp = NULL;
blocks->next = blocks->prev = *heap;

-   memset(*heap, 0, sizeof(**heap));
(*heap)->filp = (DRMFILE) - 1;
(*heap)->next = (*heap)->prev = blocks;
return 0;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 05/23] drm_dma.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
This patch does the conversion of drm_alloc + memset to drm_zalloc.
The memset in loop is also superfluous and can be removed.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_dma.c | 4624 -> 4475 (-149 bytes)
 drivers/char/drm/drm_dma.o | 104277 -> 103917 (-360 bytes)

 drivers/char/drm/drm_dma.c |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_dma.c
@@ -45,17 +45,10 @@
  */
 int drm_dma_setup(struct drm_device *dev)
 {
-   int i;
-
-   dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
+   dev->dma = drm_zalloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
if (!dev->dma)
return -ENOMEM;

-   memset(dev->dma, 0, sizeof(*dev->dma));
-
-   for (i = 0; i <= DRM_MAX_ORDER; i++)
-   memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
-
return 0;
 }

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 14/23] i915_dma.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/i915_dma.c | 22680 -> 22623 (-57 bytes)
 drivers/char/drm/i915_dma.o | 134192 -> 133704 (-488 bytes)

 drivers/char/drm/i915_dma.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/i915_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/i915_dma.c
@@ -130,8 +130,6 @@ static int i915_initialize(struct drm_de
   drm_i915_private_t * dev_priv,
   drm_i915_init_t * init)
 {
-   memset(dev_priv, 0, sizeof(drm_i915_private_t));
-
dev_priv->sarea = drm_getsarea(dev);
if (!dev_priv->sarea) {
DRM_ERROR("can not find sarea!\n");
@@ -263,9 +261,9 @@ static int i915_dma_init(DRM_IOCTL_ARGS)

switch (init.func) {
case I915_INIT_DMA:
-   dev_priv = drm_alloc(sizeof(drm_i915_private_t),
+   dev_priv = drm_zalloc(sizeof(drm_i915_private_t),
 DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   if (!dev_priv)
return DRM_ERR(ENOMEM);
retcode = i915_initialize(dev, dev_priv, &init);
break;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 02/23] drm_agpsupport.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_agpsupport.c | 13896 -> 13828 (-68 bytes)
 drivers/char/drm/drm_agpsupport.o | 120046 -> 119814 (-232 bytes)

 drivers/char/drm/drm_agpsupport.c |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_agpsupport.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_agpsupport.c
@@ -216,10 +216,10 @@ int drm_agp_alloc(struct drm_device *dev

if (!dev->agp || !dev->agp->acquired)
return -EINVAL;
-   if (!(entry = drm_alloc(sizeof(*entry), DRM_MEM_AGPLISTS)))
-   return -ENOMEM;

-   memset(entry, 0, sizeof(*entry));
+   entry = drm_zalloc(sizeof(*entry), DRM_MEM_AGPLISTS);
+   if (!entry)
+   return -ENOMEM;

pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
type = (u32) request->type;
@@ -444,11 +444,12 @@ int drm_agp_free_ioctl(struct inode *ino
  */
 struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 {
-   struct drm_agp_head *head = NULL;
+   struct drm_agp_head *head;

-   if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS)))
+   head = drm_zalloc(sizeof(*head), DRM_MEM_AGPLISTS);
+   if (!head)
return NULL;
-   memset((void *)head, 0, sizeof(*head));
+
head->bridge = agp_find_bridge(dev->pdev);
if (!head->bridge) {
if (!(head->bridge = agp_backend_acquire(dev->pdev))) {

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 23/23] via_map.c: drm_calloc to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/via_map.c | 3449 -> 3439 (-10 bytes)
 drivers/char/drm/via_map.o | 110028 -> 110488 (+460 bytes)

 drivers/char/drm/via_map.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/via_map.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/via_map.c
@@ -100,8 +100,8 @@ int via_driver_load(struct drm_device *d
drm_via_private_t *dev_priv;
int ret = 0;

-   dev_priv = drm_calloc(1, sizeof(drm_via_private_t), DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   dev_priv = drm_zalloc(sizeof(drm_via_private_t), DRM_MEM_DRIVER);
+   if (!dev_priv)
return DRM_ERR(ENOMEM);

dev->dev_private = (void *)dev_priv;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 04/23] drm_bufs.c: drm_alloc + memset to drm_alloc

2007-08-27 Thread m . kozlowski
This patch does dma_alloc and memset conversion to drm_zalloc or drm_calloc.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_bufs.c | 44959 -> 44420 (-539 bytes)
 drivers/char/drm/drm_bufs.o | 149686 -> 146822 (-2864 bytes)

 drivers/char/drm/drm_bufs.c |   31 ++-
 1 file changed, 10 insertions(+), 21 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_bufs.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_bufs.c
@@ -277,14 +277,13 @@ static int drm_addmap_core(struct drm_de
return -EINVAL;
}

-   list = drm_alloc(sizeof(*list), DRM_MEM_MAPS);
+   list = drm_zalloc(sizeof(*list), DRM_MEM_MAPS);
if (!list) {
if (map->type == _DRM_REGISTERS)
iounmap(map->handle);
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
return -EINVAL;
}
-   memset(list, 0, sizeof(*list));
list->map = map;

mutex_lock(&dev->struct_mutex);
@@ -627,14 +626,13 @@ int drm_addbufs_agp(struct drm_device *
return -EINVAL;
}

-   entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+   entry->buflist = drm_calloc(count, sizeof(*entry->buflist),
   DRM_MEM_BUFS);
if (!entry->buflist) {
mutex_unlock(&dev->struct_mutex);
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(entry->buflist, 0, count * sizeof(*entry->buflist));

entry->buf_size = size;
entry->page_order = page_order;
@@ -658,7 +656,7 @@ int drm_addbufs_agp(struct drm_device *
buf->filp = NULL;

buf->dev_priv_size = dev->driver->dev_priv_size;
-   buf->dev_private = drm_alloc(buf->dev_priv_size, DRM_MEM_BUFS);
+   buf->dev_private = drm_zalloc(buf->dev_priv_size, DRM_MEM_BUFS);
if (!buf->dev_private) {
/* Set count correctly so we free the proper amount. */
entry->buf_count = count;
@@ -667,7 +665,6 @@ int drm_addbufs_agp(struct drm_device *
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(buf->dev_private, 0, buf->dev_priv_size);

DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address);

@@ -783,16 +780,15 @@ int drm_addbufs_pci(struct drm_device *
return -EINVAL;
}

-   entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+   entry->buflist = drm_calloc(count, sizeof(*entry->buflist),
   DRM_MEM_BUFS);
if (!entry->buflist) {
mutex_unlock(&dev->struct_mutex);
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(entry->buflist, 0, count * sizeof(*entry->buflist));

-   entry->seglist = drm_alloc(count * sizeof(*entry->seglist),
+   entry->seglist = drm_calloc(count, sizeof(*entry->seglist),
   DRM_MEM_SEGS);
if (!entry->seglist) {
drm_free(entry->buflist,
@@ -801,7 +797,6 @@ int drm_addbufs_pci(struct drm_device *
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(entry->seglist, 0, count * sizeof(*entry->seglist));

/* Keep the original pagelist until we know all the allocations
 * have succeeded
@@ -869,7 +864,7 @@ int drm_addbufs_pci(struct drm_device *
buf->filp = NULL;

buf->dev_priv_size = dev->driver->dev_priv_size;
-   buf->dev_private = drm_alloc(buf->dev_priv_size,
+   buf->dev_private = drm_zalloc(buf->dev_priv_size,
 DRM_MEM_BUFS);
if (!buf->dev_private) {
/* Set count correctly so we free the proper 
amount. */
@@ -885,7 +880,6 @@ int drm_addbufs_pci(struct drm_device *
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(buf->dev_private, 0, buf->dev_priv_size);

DRM_DEBUG("buffer %d @ %p\n",
  entry->buf_count, buf->address);
@@ -1015,14 +1009,13 @@ static int drm_addbufs_sg(struct drm_dev
return -EINVAL;
}

-   entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+   entry->buflist = drm_calloc(count, sizeof(*entry->buflist),
   DRM_MEM_BUFS);
if (!entry->buflist) {
mutex_unlock(&dev->struct_mutex);
atomic_dec(&dev->buf_alloc);
return -ENOMEM;
}
-   memset(entry->buflist, 0, count * sizeof(*entry->buflist));

entry->

[PATCH 13/23] i830_dma.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/i830_dma.c | 41269 -> 41212 (-57 bytes)
 drivers/char/drm/i830_dma.o | 157920 -> 157480 (-440 bytes)

 drivers/char/drm/i830_dma.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/i830_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/i830_dma.c
@@ -336,8 +336,6 @@ static int i830_dma_initialize(struct dr
 {
struct drm_map_list *r_list;

-   memset(dev_priv, 0, sizeof(drm_i830_private_t));
-
list_for_each_entry(r_list, &dev->maplist, head) {
if (r_list->map &&
r_list->map->type == _DRM_SHM &&
@@ -465,9 +463,9 @@ static int i830_dma_init(struct inode *i

switch (init.func) {
case I830_INIT_DMA:
-   dev_priv = drm_alloc(sizeof(drm_i830_private_t),
+   dev_priv = drm_zalloc(sizeof(drm_i830_private_t),
 DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   if (!dev_priv)
return -ENOMEM;
retcode = i830_dma_initialize(dev, dev_priv, &init);
break;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 08/23] drm_irq.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_irq.c | 13062 -> 13003 (-59 bytes)
 drivers/char/drm/drm_irq.o | 114446 -> 114298 (-148 bytes)

 drivers/char/drm/drm_irq.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_irq.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_irq.c
@@ -322,13 +322,9 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)

spin_unlock_irqrestore(&dev->vbl_lock, irqflags);

-   if (!
-   (vbl_sig =
-drm_alloc(sizeof(struct drm_vbl_sig), DRM_MEM_DRIVER))) {
+   vbl_sig = drm_zalloc(sizeof(struct drm_vbl_sig), 
DRM_MEM_DRIVER);
+   if (!vbl_sig)
return -ENOMEM;
-   }
-
-   memset((void *)vbl_sig, 0, sizeof(*vbl_sig));

vbl_sig->sequence = vblwait.request.sequence;
vbl_sig->info.si_signo = vblwait.request.signal;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 07/23] drm_fops.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_fops.c | 11849 -> 11817 (-32 bytes)
 drivers/char/drm/drm_fops.o | 115963 -> 115177 (-786 bytes)

 drivers/char/drm/drm_fops.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_fops.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_fops.c
@@ -236,11 +236,10 @@ static int drm_open_helper(struct inode

DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor);

-   priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES);
+   priv = drm_zalloc(sizeof(*priv), DRM_MEM_FILES);
if (!priv)
return -ENOMEM;

-   memset(priv, 0, sizeof(*priv));
filp->private_data = priv;
priv->uid = current->euid;
priv->pid = current->pid;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 11/23] drm_stub.c: drm_calloc to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_stub.c | 7731 -> 7728 (-3 bytes)
 drivers/char/drm/drm_stub.o | 110301 -> 111354 (+1053 bytes)

 drivers/char/drm/drm_stub.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_stub.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_stub.c
@@ -210,7 +210,7 @@ int drm_get_dev(struct pci_dev *pdev, co

DRM_DEBUG("\n");

-   dev = drm_calloc(1, sizeof(*dev), DRM_MEM_STUB);
+   dev = drm_zalloc(sizeof(*dev), DRM_MEM_STUB);
if (!dev)
return -ENOMEM;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 10/23] drm_sman.c: drm_calloc to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_sman.c | 9108 -> 9094 (-14 bytes)
 drivers/char/drm/drm_sman.o | 104466 -> 103946 (-520 bytes)

 drivers/char/drm/drm_sman.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_sman.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_sman.c
@@ -130,10 +130,10 @@ drm_sman_set_range(struct drm_sman * sma
BUG_ON(manager >= sman->num_managers);

sman_mm = &sman->mm[manager];
-   mm = drm_calloc(1, sizeof(*mm), DRM_MEM_MM);
-   if (!mm) {
+   mm = drm_zalloc(sizeof(*mm), DRM_MEM_MM);
+   if (!mm)
return -ENOMEM;
-   }
+
sman_mm->private = mm;
ret = drm_mm_init(mm, start, size);

@@ -176,7 +176,7 @@ static struct drm_owner_item *drm_sman_g
  owner_hash);
}

-   owner_item = drm_calloc(1, sizeof(*owner_item), DRM_MEM_MM);
+   owner_item = drm_zalloc(sizeof(*owner_item), DRM_MEM_MM);
if (!owner_item)
goto out;

@@ -212,8 +212,7 @@ struct drm_memblock_item *drm_sman_alloc
return NULL;
}

-   memblock = drm_calloc(1, sizeof(*memblock), DRM_MEM_MM);
-
+   memblock = drm_zalloc(sizeof(*memblock), DRM_MEM_MM);
if (!memblock)
goto out;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 17/23] mga_dma.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/mga_dma.c | 30418 -> 30253 (-165 bytes)
 drivers/char/drm/mga_dma.o | 140668 -> 140304 (-364 bytes)

 drivers/char/drm/mga_dma.c |   14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/mga_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/mga_dma.c
@@ -254,23 +254,20 @@ static int mga_freelist_init(struct drm_
int i;
DRM_DEBUG("count=%d\n", dma->buf_count);

-   dev_priv->head = drm_alloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
-   if (dev_priv->head == NULL)
+   dev_priv->head = drm_zalloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
+   if (!dev_priv->head)
return DRM_ERR(ENOMEM);

-   memset(dev_priv->head, 0, sizeof(drm_mga_freelist_t));
SET_AGE(&dev_priv->head->age, MGA_BUFFER_USED, 0);

for (i = 0; i < dma->buf_count; i++) {
buf = dma->buflist[i];
buf_priv = buf->dev_private;

-   entry = drm_alloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
-   if (entry == NULL)
+   entry = drm_zalloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
+   if (!entry)
return DRM_ERR(ENOMEM);

-   memset(entry, 0, sizeof(drm_mga_freelist_t));
-
entry->next = dev_priv->head->next;
entry->prev = dev_priv->head;
SET_AGE(&entry->age, MGA_BUFFER_FREE, 0);
@@ -397,12 +394,11 @@ int mga_driver_load(struct drm_device *
 {
drm_mga_private_t *dev_priv;

-   dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER);
+   dev_priv = drm_zalloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER);
if (!dev_priv)
return DRM_ERR(ENOMEM);

dev->dev_private = (void *)dev_priv;
-   memset(dev_priv, 0, sizeof(drm_mga_private_t));

dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT;
dev_priv->chipset = flags;

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: uncached page allocator

2007-08-27 Thread Christoph Lameter
There is an uncached allocator in IA64 arch code 
(linux/arch/ia64/kernel/uncached.c). Maybe having a look at 
that will help? Jes wrote it.

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 09/23] drm_scatter.c: drm_alloc + memset to drm_alloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_scatter.c | 6113 -> 5945 (-168 bytes)
 drivers/char/drm/drm_scatter.o | 105552 -> 105584 (+32 bytes)

 drivers/char/drm/drm_scatter.c |   11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_scatter.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_scatter.c
@@ -83,26 +83,22 @@ int drm_sg_alloc(struct inode *inode, st
if (copy_from_user(&request, argp, sizeof(request)))
return -EFAULT;

-   entry = drm_alloc(sizeof(*entry), DRM_MEM_SGLISTS);
+   entry = drm_zalloc(sizeof(*entry), DRM_MEM_SGLISTS);
if (!entry)
return -ENOMEM;

-   memset(entry, 0, sizeof(*entry));
-
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
DRM_DEBUG("sg size=%ld pages=%ld\n", request.size, pages);

entry->pages = pages;
-   entry->pagelist = drm_alloc(pages * sizeof(*entry->pagelist),
+   entry->pagelist = drm_calloc(pages, sizeof(*entry->pagelist),
DRM_MEM_PAGES);
if (!entry->pagelist) {
drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS);
return -ENOMEM;
}

-   memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist));
-
-   entry->busaddr = drm_alloc(pages * sizeof(*entry->busaddr),
+   entry->busaddr = drm_calloc(pages, sizeof(*entry->busaddr),
   DRM_MEM_PAGES);
if (!entry->busaddr) {
drm_free(entry->pagelist,
@@ -111,7 +107,6 @@ int drm_sg_alloc(struct inode *inode, st
drm_free(entry, sizeof(*entry), DRM_MEM_SGLISTS);
return -ENOMEM;
}
-   memset((void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr));

entry->virtual = vmalloc_32(pages << PAGE_SHIFT);
if (!entry->virtual) {

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 15/23] i915_irq.c: drm_calloc to drm_zalloc and bugfix

2007-08-27 Thread m . kozlowski
This patch does drm_calloc to drm_zalloc conversion. Also it
seems that unpatched version allocated wrong nr of bytes.

drm_i915_vbl_swap_t *vbl_swap;

...

sizeof(vbl_swap) vs. sizeof(*vbl_swap)

No?

Please review.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/i915_irq.c | 15749 -> 15746 (-3 bytes)
 drivers/char/drm/i915_irq.o | 128940 -> 128856 (-84 bytes)

 drivers/char/drm/i915_irq.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/i915_irq.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/i915_irq.c
@@ -541,8 +541,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS)
return DRM_ERR(EBUSY);
}

-   vbl_swap = drm_calloc(1, sizeof(vbl_swap), DRM_MEM_DRIVER);
-
+   vbl_swap = drm_zalloc(sizeof(*vbl_swap), DRM_MEM_DRIVER);
if (!vbl_swap) {
DRM_ERROR("Failed to allocate memory to queue swap\n");
return DRM_ERR(ENOMEM);

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 06/23] drm_drawable.c: drm_calloc to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_drawable.c | 5425 -> 5422 (-3 bytes)
 drivers/char/drm/drm_drawable.o | 108201 -> 107765 (-436 bytes)

 drivers/char/drm/drm_drawable.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_drawable.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_drawable.c
@@ -110,7 +110,7 @@ int drm_update_drawable_info(DRM_IOCTL_A

info = idr_find(&dev->drw_idr, update.handle);
if (!info) {
-   info = drm_calloc(1, sizeof(*info), DRM_MEM_BUFS);
+   info = drm_zalloc(sizeof(*info), DRM_MEM_BUFS);
if (!info)
return -ENOMEM;
if (IS_ERR(idr_replace(&dev->drw_idr, info, update.handle))) {

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 03/23] drm_auth.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drm_auth.c | 5835 -> 5802 (-33 bytes)
 drivers/char/drm/drm_auth.o | 104968 -> 104860 (-108 bytes)

 drivers/char/drm/drm_auth.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_auth.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_auth.c
@@ -78,12 +78,11 @@ static int drm_add_magic(struct drm_devi

DRM_DEBUG("%d\n", magic);

-   entry = drm_alloc(sizeof(*entry), DRM_MEM_MAGIC);
+   entry = drm_zalloc(sizeof(*entry), DRM_MEM_MAGIC);
if (!entry)
return -ENOMEM;
-   memset(entry, 0, sizeof(*entry));
-   entry->priv = priv;

+   entry->priv = priv;
entry->hash_item.key = (unsigned long)magic;
mutex_lock(&dev->struct_mutex);
drm_ht_insert_item(&dev->magiclist, &entry->hash_item);

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 00/23] drm: introduce drm_zalloc

2007-08-27 Thread m . kozlowski
Hello,

As there are many places in drm code where drm_alloc + memset is used
this patch series introduces drm_zalloc and also makes use of drm_calloc where
needed. Most of these patches save some bytes so the benefit is a few kB saved
(gcc 4.1.2) with patch applied. Also some small (style, etc.) things are fixed.
This patch series does the conversion drm tree-wide. All patches were compile
tested.

Patches are against 2.6.23-rc3-mm1. Please review and apply.

Regards,

Mariusz


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 18/23] r128_cce.c: drm_alloc + memset to drm_zalloc

2007-08-27 Thread m . kozlowski
Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/r128_cce.c | 25912 -> 25792 (-120 bytes)
 drivers/char/drm/r128_cce.o | 133640 -> 133468 (-172 bytes)

 drivers/char/drm/r128_cce.c |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/r128_cce.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/r128_cce.c
@@ -353,12 +353,10 @@ static int r128_do_init_cce(struct drm_d

DRM_DEBUG("\n");

-   dev_priv = drm_alloc(sizeof(drm_r128_private_t), DRM_MEM_DRIVER);
-   if (dev_priv == NULL)
+   dev_priv = drm_zalloc(sizeof(drm_r128_private_t), DRM_MEM_DRIVER);
+   if (!dev_priv)
return DRM_ERR(ENOMEM);

-   memset(dev_priv, 0, sizeof(drm_r128_private_t));
-
dev_priv->is_pci = init->is_pci;

if (dev_priv->is_pci && !dev->sg) {
@@ -778,11 +776,10 @@ static int r128_freelist_init(struct drm
drm_r128_freelist_t *entry;
int i;

-   dev_priv->head = drm_alloc(sizeof(drm_r128_freelist_t), DRM_MEM_DRIVER);
-   if (dev_priv->head == NULL)
+   dev_priv->head = drm_zalloc(sizeof(drm_r128_freelist_t), 
DRM_MEM_DRIVER);
+   if (!dev_priv->head)
return DRM_ERR(ENOMEM);

-   memset(dev_priv->head, 0, sizeof(drm_r128_freelist_t));
dev_priv->head->age = R128_BUFFER_USED;

for (i = 0; i < dma->buf_count; i++) {

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH 01/23] introduce drm_zalloc as a drm_alloc + memset replacement

2007-08-27 Thread m . kozlowski
Add drm_zalloc().

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>

 drivers/char/drm/drmP.h |7 +++
 drivers/char/drm/drm_memory_debug.h |   17 ++---
 2 files changed, 21 insertions(+), 3 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drmP.h
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drmP.h
@@ -1125,10 +1125,17 @@ static __inline__ void *drm_calloc(size_
 {
return kcalloc(nmemb, size, GFP_KERNEL);
 }
+
+/** Wrapper around kzalloc() */
+static __inline__ void *drm_zalloc(size_t size, int area)
+{
+   return kzalloc(size, GFP_KERNEL);
+}
 #else
 extern void *drm_alloc(size_t size, int area);
 extern void drm_free(void *pt, size_t size, int area);
 extern void *drm_calloc(size_t nmemb, size_t size, int area);
+extern void *drm_zalloc(size_t size, int area);
 #endif
 
 /[EMAIL PROTECTED]/
--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_memory_debug.h
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_memory_debug.h
@@ -167,13 +167,24 @@ void *drm_alloc (size_t size, int area) 
 void *drm_calloc (size_t nmemb, size_t size, int area) {
void *addr;
 
-   addr = drm_alloc (nmemb * size, area);
-   if (addr != NULL)
-   memset((void *)addr, 0, size * nmemb);
+   addr = drm_alloc(nmemb * size, area);
+   if (!addr)
+   memset(addr, 0, size * nmemb);
 
return addr;
 }
 
+void *drm_zalloc(size_t size, int area)
+{
+   void *addr;
+
+   addr = drm_alloc(size, area);
+   if (!addr)
+   memset(addr, 0, size);
+   
+   return addr;
+}
+
 void *drm_realloc (void *oldpt, size_t oldsize, size_t size, int area) {
void *pt;
 

--

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12184] r200BindTexture(): texObj->DriverData != NULL assertion failed

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=12184





--- Comment #1 from [EMAIL PROTECTED]  2007-08-27 13:19 PST ---
Created an attachment (id=11294)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=11294&action=view)
Proposed patch (works for me).


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12184] New: r200BindTexture(): texObj->DriverData != NULL assertion failed

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=12184

   Summary: r200BindTexture(): texObj->DriverData != NULL assertion
failed
   Product: Mesa
   Version: unspecified
  Platform: Other
OS/Version: FreeBSD
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/DRI/r200
AssignedTo: dri-devel@lists.sourceforge.net
ReportedBy: [EMAIL PROTECTED]


The r200NewTextureObject() function does not check return value of the
r200AllocTexObj(). As consequence, texture without valid DriverData may
be returned. Later, attempt to bind the texture would result in assertion
stated as summary of the bug.


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 10224] r200 driver freezes with Radeon 8500

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=10224





--- Comment #7 from [EMAIL PROTECTED]  2007-08-27 12:39 PST ---
Eventually, it does freezes quite easily with both boswars, openarena and
warzone2100 (http://wz2100.net/) though I can sometimes kill it from the
console[1], othertimes, I can only use kernel's magic sysrq keys and one time,
I'd to hard reset the machine :-(

[1] the X server is then usable again but for the resolution which is
640x480 though xrandr pretends not:
# xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1024 x 1024
VGA-0 connected 640x480+0+0 (normal left inverted right x axis y axis) 310mm x
230mm
   1024x768   85.0 +   84.9 75.1 70.1 60.0
   800x60084.9 72.2 75.0 60.3 56.2
   768x576   100.0 79.4
   640x48075.0*72.8 60.0
   20x40070.1

All xrandr calls succeeds w/o actually changing the resolution but krandrtray
succeeds.


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] debug mode configure changes

2007-08-27 Thread Leandro Dorileo
Changing the enable/disable mechanism for debug in drm, now
it may be defined while configuring the kernel, does not need
to change the source code to enable or disable it, a bit closer
to what has been done in the rest of the kernel.

Signed-off-by: Leandro Dorileo <[EMAIL PROTECTED]>
---
  drivers/char/drm/Kconfig|6 ++
  drivers/char/drm/drmP.h |5 +
  drivers/char/drm/drm_proc.c |6 +++---
  3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
index 0b7ffa5..2794175 100644
--- a/drivers/char/drm/Kconfig
+++ b/drivers/char/drm/Kconfig
@@ -16,6 +16,12 @@ config DRM
  details.  You should also select and configure AGP
  (/dev/agpgart) support.
  
+config DRM_DEBUG
+   bool "DRM debuging"
+   depends DRM
+   help
+ Enables DRM debuging - development only.
+
  config DRM_TDFX
tristate "3dfx Banshee/Voodoo3+"
depends on DRM && PCI
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 0df87fc..babb238 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -105,9 +105,6 @@
  /** \name Begin the DRM... */
  /[EMAIL PROTECTED]/
  
-#define DRM_DEBUG_CODE 2 /**< Include debugging code if > 1, then
-also include looping detection. */
-
  #define DRM_MAGIC_HASH_ORDER  4  /**< Size of key hash table. Must be power 
of 2. */
  #define DRM_KERNEL_CONTEXT0/**< Change drm_resctx if changed */
  #define DRM_RESERVED_CONTEXTS 1/**< Change drm_resctx if changed */
@@ -179,7 +176,7 @@
   * \param fmt printf() like format string.
   * \param arg arguments
   */
-#if DRM_DEBUG_CODE
+#if CONFIG_DRM_DEBUG
  #define DRM_DEBUG(fmt, arg...)
\
do {\
if ( drm_debug )\
diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c
index 12dfea8..49cbe09 100644
--- a/drivers/char/drm/drm_proc.c
+++ b/drivers/char/drm/drm_proc.c
@@ -49,7 +49,7 @@ static int drm_queues_info(char *buf, char **start, off_t 
offset,
   int request, int *eof, void *data);
  static int drm_bufs_info(char *buf, char **start, off_t offset,
 int request, int *eof, void *data);
-#if DRM_DEBUG_CODE
+#ifdef CONFIG_DRM_DEBUG
  static int drm_vma_info(char *buf, char **start, off_t offset,
int request, int *eof, void *data);
  #endif
@@ -67,7 +67,7 @@ static struct drm_proc_list {
{"clients", drm_clients_info},
{"queues", drm_queues_info},
{"bufs", drm_bufs_info},
-#if DRM_DEBUG_CODE
+#if CONFIG_DRM_DEBUG
{"vma", drm_vma_info},
  #endif
  };
@@ -471,7 +471,7 @@ static int drm_clients_info(char *buf, char **start, off_t 
offset,
return ret;
  }
  
-#if DRM_DEBUG_CODE
+#if CONFIG_DRM_DEBUG
  
  static int drm__vma_info(char *buf, char **start, off_t offset, int request,
 int *eof, void *data)
-- 
1.5.2.4


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 8946] Unable to use TTM-based memory manager

2007-08-27 Thread bugme-daemon
http://bugzilla.kernel.org/show_bug.cgi?id=8946





--- Comment #1 from [EMAIL PROTECTED]  2007-08-27 11:24 ---
You will need to wait for 2.6.24, merge window is closed now.


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: DRM enhancements document

2007-08-27 Thread Matthias Hopf
On Aug 23, 07 12:00:39 +0300, Daniel Stone wrote:
> > > If you have ioctl number 32, your next free one is 43, and you want to
> > > change the semantics of UPDATE_WINDOW, then you rename 32 to
> > > UPDATE_WINDOW_OLD, create UPDATE_WINDOW as 43 with the new structure,
> > > and handle both cases.
> > 
> > I consider this giving headaches.
> > I never had any similar issues with a tag-based approach.
> 
> The problem there comes with the added complexity of parsing all the
> data.

Maybe I'm a bit biased (had an Amiga for a long time, and this was the
base argument parsing for OS routines), but it worked astonishingly
well.

> > If every tag is int32 and its parameter int32 as well, this isn't too
> > problematic. Question is whether everything needed can be represented in
> > 32 bit values, strings are a completely different concept and don't
> > match well here, as pointers are probably difficult to handle over the
> > user land / kernel barrier...
> 
> Easy to use, hard to use right.

Right.

Matthias

-- 
Matthias Hopf <[EMAIL PROTECTED]>  ____   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__  [EMAIL PROTECTED]
Phone +49-911-74053-715   __)  |_|  __)  |__  R & D   www.mshopf.de

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 8946] New: Unable to use TTM-based memory manager

2007-08-27 Thread bugme-daemon
http://bugzilla.kernel.org/show_bug.cgi?id=8946

   Summary: Unable to use TTM-based memory manager
   Product: Drivers
   Version: 2.5
 KernelVersion: 2.6.23-rc3-git10
  Platform: All
OS/Version: Linux
  Tree: Mainline
Status: NEW
  Severity: normal
  Priority: P1
 Component: Video(DRI)
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


xf86-video-intel-2.1.1 require DRM version at least 1.7.0 to use TTM-based
memory manager.
Kernel has version 1.6.0 instead of 1.9.0 (latest).


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[Bug 12106] i810 modules cause drm to print *Errors* when X startups

2007-08-27 Thread bugzilla-daemon
http://bugs.freedesktop.org/show_bug.cgi?id=12106


[EMAIL PROTECTED] changed:

   What|Removed |Added

 AssignedTo|[EMAIL PROTECTED]|dri-
   |g   |[EMAIL PROTECTED]
  Component|Bugzilla|DRM modules
Product|freedesktop.org |DRI




--- Comment #1 from [EMAIL PROTECTED]  2007-08-27 07:35 PST ---
Not a sitewranglers bug.


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

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel