[PATCH] Move nv30, nv50 and nvc0 to nouveau.

2013-09-05 Thread Johannes Obermayr
---

Sorry for annoying the mailing list but ...

irc_dri-devel
[Dienstag, 20. August 2013] [21:23:56] jobermayr  calim: Would you accept 
such a patch: https://github.com/jobermayr/mesa/commit/b859d1d
[Dienstag, 20. August 2013] [21:56:05] calim  jobermayr: what's that good for 
?
[Dienstag, 20. August 2013] [21:56:33] calim  ah, you moved everything into a 
nouveau subdir
[Dienstag, 20. August 2013] [21:59:42] calim  hm, I don't care, doesn't 
really have an effect other than requiring more key presses to reach the driver 
dir
key_statement
[Dienstag, 20. August 2013] [21:59:58] calim  so, I'd accept it
/key_statement
[Dienstag, 20. August 2013] [22:01:00] calim  but you remove the ability to 
not build nv30 support ...
[Dienstag, 20. August 2013] [22:02:45] calim  I mean, you could have kept the 
separate libnvXX.a
note_from_today
Depending targets (dri-nouveau, egl-static, pipe-loader, vdpau-nouveau, 
xorg-nouveau and xmvc-nouveau) require nv30_screen_create, nv50_screen_create 
and nvc0_screen_create in nouveau_drm_screen_create (libnouveaudrm.la). So it 
is not possible not to build nv30 and since all three former libnvXX.la are 
required it makes sense to build only one libnouveau.la ...
/note_from_today
[Dienstag, 20. August 2013] [22:38:05] jobermayr  calim: It only builds 
one libnouveau library, a bit faster compile times on -jX and all things which 
go into it are better structured
/irc_dri-devel

email_in_german
Am Dienstag, 20. August 2013, 23:27:59 schrieb Johannes Obermayr an Christoph 
Bumiller:
 Hallo Christoph,
 
 anbei der Patch zur Umstrukturierung (entpackt ~ 4 MB, deshalb nicht an die 
 Liste ...).
 
 Falls mal aboll's und mein Wunsch in Erfüllung gehen sollte und wir die 
 Shared-Libs-Patches einspielen dürfen, müssen dann in libnouveau.so nur die 
 drei *_screen_create Symbole freigegeben werden.
 
 Wie vorhin auf der Liste angekündigt gibt es einen kleinen 
 Geschwindigkeitsbonus beim Kompilieren obendrein 

 Gruß
 Johannes
/email_in_german

irc_dri-devel
[Sonntag, 1. September 2013] [23:23:37] jobermayr calim: This commit also 
contains whiteline and new blank line at EOF fixes: 
https://github.com/jobermayr/mesa/commit/5a677fc . Is it sth. you will push to 
master or must I maintain it in my branch?
[Donnerstag, 5. September 2013] [17:56:33] jobermayr_ calim: What about 
pushing https://github.com/jobermayr/mesa/commit/def1781 and for 9.2: 
https://github.com/jobermayr/mesa/commit/03073db ? Don't you accept it anymore?
/irc_dri-devel

general_question
Why is it so difficult to get an agreed patch in master?
/general_question

---
 configure.ac   |5 +-
 src/gallium/Android.mk |5 +-
 src/gallium/drivers/Makefile.am|2 +-
 src/gallium/drivers/nouveau/Android.mk |8 +-
 src/gallium/drivers/nouveau/Makefile.am|   14 +-
 src/gallium/drivers/nouveau/Makefile.sources   |   91 +
 src/gallium/drivers/nouveau/codegen/nv50_ir.cpp| 1231 
 src/gallium/drivers/nouveau/codegen/nv50_ir.h  | 1197 
 src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp |  550 
 .../drivers/nouveau/codegen/nv50_ir_build_util.cpp |  614 
 .../drivers/nouveau/codegen/nv50_ir_build_util.h   |  324 +++
 .../drivers/nouveau/codegen/nv50_ir_driver.h   |  220 ++
 .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 1682 +++
 .../drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp  | 1962 +
 .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp  | 2988 
 .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp  | 2852 +++
 .../drivers/nouveau/codegen/nv50_ir_graph.cpp  |  436 +++
 .../drivers/nouveau/codegen/nv50_ir_graph.h|  228 ++
 .../drivers/nouveau/codegen/nv50_ir_inlines.h  |  420 +++
 .../nouveau/codegen/nv50_ir_lowering_nv50.cpp  | 1101 
 .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp  | 1597 +++
 .../drivers/nouveau/codegen/nv50_ir_peephole.cpp   | 2464 
 .../drivers/nouveau/codegen/nv50_ir_print.cpp  |  698 +
 src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 2050 ++
 .../drivers/nouveau/codegen/nv50_ir_ssa.cpp|  552 
 .../drivers/nouveau/codegen/nv50_ir_target.cpp |  469 +++
 .../drivers/nouveau/codegen/nv50_ir_target.h   |  235 ++
 .../nouveau/codegen/nv50_ir_target_nv50.cpp|  552 
 .../drivers/nouveau/codegen/nv50_ir_target_nv50.h  |   72 +
 .../nouveau/codegen/nv50_ir_target_nvc0.cpp|  604 
 .../drivers/nouveau/codegen/nv50_ir_target_nvc0.h  |   74 +
 .../drivers/nouveau/codegen/nv50_ir_util.cpp   |  390 +++
 src/gallium/drivers/nouveau/codegen/nv50_ir_util.h |  788 ++
 .../drivers/nouveau/codegen/target_lib_nvc0.asm|   96 +
 .../drivers/nouveau/codegen/target_lib_nvc0.asm.h  |  112 +
 .../drivers/nouveau/codegen/target_lib_nve4.asm|  698 +
 .../drivers/nouveau

drm-next status (or: drm-openchrome will not be in 3.11)

2013-06-30 Thread Johannes Obermayr
Am Freitag, 28. Juni 2013, 13:31:50 schrieb Dave Airlie:
> Okay drm-next is pretty big, possibly the biggest ever.
> 
> Outstanding things I know about, and will merge, if they arrive soon:
> exynos -next
> nouveau -next
> 
> Big things I've merged:
> new rcar driver
> intel next
> radeon next
> tegra next
> shmob next
> core/mutexes
> ttm -> reservation conversion
> tilcdc patches acked by Rob
> mtrr reworking
> prime + gem patches from samsung
> Laurent's documentation updates
> various mgag200 patches
> 
> Otherwise I'm sure I've missed some changes, please let me know of
> anything you think has fallen down the cracks asap.
> 
> Slow down people :-P
> 
> Dave.

IRC #dri-devel:

 airlied: drm-openchrome will not be part of Kernel 3.11 because 
jsimmons has not responded?

 jobermayr: seems likely, I don't merge just because someone posts 
patchrs


Tasks to do:
http://lists.freedesktop.org/archives/dri-devel/2013-June/039695.html
http://lists.freedesktop.org/archives/dri-devel/2013-June/039796.html


Re: drm-next status (or: drm-openchrome will not be in 3.11)

2013-06-30 Thread Johannes Obermayr
Am Freitag, 28. Juni 2013, 13:31:50 schrieb Dave Airlie:
 Okay drm-next is pretty big, possibly the biggest ever.
 
 Outstanding things I know about, and will merge, if they arrive soon:
 exynos -next
 nouveau -next
 
 Big things I've merged:
 new rcar driver
 intel next
 radeon next
 tegra next
 shmob next
 core/mutexes
 ttm - reservation conversion
 tilcdc patches acked by Rob
 mtrr reworking
 prime + gem patches from samsung
 Laurent's documentation updates
 various mgag200 patches
 
 Otherwise I'm sure I've missed some changes, please let me know of
 anything you think has fallen down the cracks asap.
 
 Slow down people :-P
 
 Dave.

IRC #dri-devel:

jobermayr_ airlied: drm-openchrome will not be part of Kernel 3.11 because 
jsimmons has not responded?

airlied jobermayr: seems likely, I don't merge just because someone posts 
patchrs


Tasks to do:
http://lists.freedesktop.org/archives/dri-devel/2013-June/039695.html
http://lists.freedesktop.org/archives/dri-devel/2013-June/039796.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


drm-openchrome status (or will it be in Kernel 3.10?)

2013-04-30 Thread Johannes Obermayr
Am Dienstag, 30. April 2013, 06:06:22 schrieb Dave Airlie:
> On Tue, Apr 30, 2013 at 2:17 AM, Johannes Obermayr
>  wrote:
> > Hi James,
> >
> > Linus recently released Kernel 3.9, merge window for Kernel 3.10 has been 
> > opened, and the question is whether drm-openchrome will be part of the new 
> > Kernel version.
> 
> Johannes,
> 
> you misunderstand merge window. The merge window is for stuff to go
> from toplevel maintainers to Linus, not for new stuff to appear and be
> merged.

Dave,

I know you maintain also a merge window for drm stuff which starts at ~ rc6.

But I am unsure when it closes: When Linus opens his merge window or when you 
forward your main drm pull request to Linus.
First case means it is definitely too late for drm-openchrome in 3.10. Second 
case means there can be hope (depending on James' answer) ...

But regarding your answer I assume first case is right.


Johannes


drm-openchrome status (or will it be in Kernel 3.10?)

2013-04-29 Thread Johannes Obermayr
Hi James,

Linus recently released Kernel 3.9, merge window for Kernel 3.10 has been 
opened, and the question is whether drm-openchrome will be part of the new 
Kernel version.

Regards,
Johannes 


drm-openchrome status (or will it be in Kernel 3.10?)

2013-04-29 Thread Johannes Obermayr
Hi James,

Linus recently released Kernel 3.9, merge window for Kernel 3.10 has been 
opened, and the question is whether drm-openchrome will be part of the new 
Kernel version.

Regards,
Johannes 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: drm-openchrome status (or will it be in Kernel 3.10?)

2013-04-29 Thread Johannes Obermayr
Am Dienstag, 30. April 2013, 06:06:22 schrieb Dave Airlie:
 On Tue, Apr 30, 2013 at 2:17 AM, Johannes Obermayr
 johannesoberm...@gmx.de wrote:
  Hi James,
 
  Linus recently released Kernel 3.9, merge window for Kernel 3.10 has been 
  opened, and the question is whether drm-openchrome will be part of the new 
  Kernel version.
 
 Johannes,
 
 you misunderstand merge window. The merge window is for stuff to go
 from toplevel maintainers to Linus, not for new stuff to appear and be
 merged.

Dave,

I know you maintain also a merge window for drm stuff which starts at ~ rc6.

But I am unsure when it closes: When Linus opens his merge window or when you 
forward your main drm pull request to Linus.
First case means it is definitely too late for drm-openchrome in 3.10. Second 
case means there can be hope (depending on James' answer) ...

But regarding your answer I assume first case is right.


Johannes
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/6] modetest.c: Add return 0 in bit_name_fn(res) macro.

2012-07-13 Thread Johannes Obermayr
---
 tests/modetest/modetest.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ec3121e..00129fa 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -128,6 +128,7 @@ char * res##_str(int type) {
\
sep = ", "; \
}   \
}   \
+   return 0;   \
 }

 static const char *mode_type_names[] = {
-- 
1.7.7



[PATCH 5/6] xf86drm.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index e652731..c1cc170 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1399,8 +1399,11 @@ drm_context_t *drmGetReservedContextList(int fd, int 
*count)
 }

 res.contexts = list;
-if (drmIoctl(fd, DRM_IOCTL_RES_CTX, ))
+if (drmIoctl(fd, DRM_IOCTL_RES_CTX, )) {
+   drmFree(list);
+   drmFree(retval);
return NULL;
+}

 for (i = 0; i < res.count; i++)
retval[i] = list[i].handle;
-- 
1.7.7



[PATCH 4/6] xf86drm.c: Make more code UDEV unrelevant.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 6ea068f..e652731 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -255,6 +255,7 @@ static int drmMatchBusID(const char *id1, const char *id2, 
int pci_domain_ok)
 return 0;
 }

+#if !defined(UDEV)
 /**
  * Handles error checking for chown call.
  *
@@ -284,6 +285,7 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
path, errno, strerror(errno));
return -1;
 }
+#endif

 /**
  * Open the DRM device, creating it if necessary.
@@ -303,14 +305,17 @@ static int drmOpenDevice(long dev, int minor, int type)
 stat_t  st;
 charbuf[64];
 int fd;
+#if !defined(UDEV)
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
 int isroot  = !geteuid();
 uid_t   user= DRM_DEV_UID;
 gid_t   group   = DRM_DEV_GID, serv_group;
-
+#endif
+
 sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, 
minor);
 drmMsg("drmOpenDevice: node name is %s\n", buf);

+#if !defined(UDEV)
 if (drm_server_info) {
drm_server_info->get_perms(_group, _mode);
devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
@@ -318,7 +323,6 @@ static int drmOpenDevice(long dev, int minor, int type)
group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
 }

-#if !defined(UDEV)
 if (stat(DRM_DIR_NAME, )) {
if (!isroot)
return DRM_ERR_NOT_ROOT;
-- 
1.7.7



[PATCH 3/6] nouveau/nouveau.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 nouveau/nouveau.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 5aa4107..e91287f 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -95,6 +95,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device 
**pdev)
(dev->drm_version <  0x0100 ||
 dev->drm_version >= 0x0200)) {
nouveau_device_del();
+   free(nvdev);
return -EINVAL;
}

@@ -105,6 +106,7 @@ nouveau_device_wrap(int fd, int close, struct 
nouveau_device **pdev)
ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, );
if (ret) {
nouveau_device_del();
+   free(nvdev);
return ret;
}

-- 
1.7.7



[PATCH 2/6] libkms/nouveau.c: Fix a memory leak and make some code easier to read.

2012-07-13 Thread Johannes Obermayr
---
 libkms/nouveau.c |   27 ++-
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a15..fbca6fe 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -90,21 +90,24 @@ nouveau_bo_create(struct kms_driver *kms,
}
}

-   bo = calloc(1, sizeof(*bo));
-   if (!bo)
-   return -ENOMEM;
-
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * height;
-   } else {
+   break;
+   default:
return -EINVAL;
}

+   bo = calloc(1, sizeof(*bo));
+   if (!bo)
+   return -ENOMEM;
+
memset(, 0, sizeof(arg));
arg.info.size = size;
arg.info.domain = NOUVEAU_GEM_DOMAIN_MAPPABLE | NOUVEAU_GEM_DOMAIN_VRAM;
@@ -114,8 +117,10 @@ nouveau_bo_create(struct kms_driver *kms,
arg.channel_hint = 0;

ret = drmCommandWriteRead(kms->fd, DRM_NOUVEAU_GEM_NEW, , 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }

bo->base.kms = kms;
bo->base.handle = arg.info.handle;
@@ -126,10 +131,6 @@ nouveau_bo_create(struct kms_driver *kms,
*out = >base;

return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }

 static int
-- 
1.7.7



[PATCH 1/6] libkms/intel.c: Fix a memory leak and a dead assignment as well as make some code easier to read.

2012-07-13 Thread Johannes Obermayr
---
 libkms/intel.c |   32 +---
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..12175b0 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -89,27 +89,32 @@ intel_bo_create(struct kms_driver *kms,
}
}

-   bo = calloc(1, sizeof(*bo));
-   if (!bo)
-   return -ENOMEM;
-
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * ((height + 4 - 1) & ~(4 - 1));
-   } else {
+   break;
+   default:
return -EINVAL;
}

+   bo = calloc(1, sizeof(*bo));
+   if (!bo)
+   return -ENOMEM;
+
memset(, 0, sizeof(arg));
arg.size = size;

ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_CREATE, , 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }

bo->base.kms = kms;
bo->base.handle = arg.handle;
@@ -124,21 +129,18 @@ intel_bo_create(struct kms_driver *kms,
tile.handle = bo->base.handle;
tile.tiling_mode = I915_TILING_X;
tile.stride = bo->base.pitch;
-
-   ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, 
, sizeof(tile));
 #if 0
+   ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, 
, sizeof(tile));
if (ret) {
kms_bo_destroy(out);
return ret;
}
+#else
+   drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, , 
sizeof(tile));
 #endif
}

return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }

 static int
-- 
1.7.7



libdrm: Fix some warnings reported by clang's scan-build tool [try 2]

2012-07-13 Thread Johannes Obermayr

Am Freitag, 13. Juli 2012, 18:47:50 schrieb Marcin Slusarz:
> On Fri, Jul 13, 2012 at 05:49:12PM +0200, Johannes Obermayr wrote:
> > 
> > Patches 1 to 4 were sent to mesa-dev.
> 
> And you chose to ignore most of my comments.
> Fine. Don't expect further reviews from me.
> 
> Marcin

Patch 1 and 2:
- Adapted
- I want to keep proposed easier to read "switch" case

Patch 3:
- Resend
- Waiting on your response: 
http://lists.freedesktop.org/archives/mesa-dev/2012-June/023456.html

Patch 4 and 5:
- Splitted
- http://llvm.org/bugs/show_bug.cgi?id=13358 (forgot to split and to add 
'drmFree(list);')
- The 'more if's case' seems better to me

Patch 6:
- Resend

Marcin, not that I ignore comments. But sometimes I want to hear also opinions 
from (some more) other people.
I hope I can calm the waves ...

Johannes


[PATCH 5/5] modetest.c: Add return 0 in bit_name_fn(res) macro.

2012-07-13 Thread Johannes Obermayr
---
 tests/modetest/modetest.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ec3121e..00129fa 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -128,6 +128,7 @@ char * res##_str(int type) {
\
sep = ", "; \
}   \
}   \
+   return 0;   \
 }

 static const char *mode_type_names[] = {
-- 
1.7.7



[PATCH 4/5] xf86drm.c: Make more code UDEV unrelevant and fix a memory leak.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 6ea068f..e3789c8 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -255,6 +255,7 @@ static int drmMatchBusID(const char *id1, const char *id2, 
int pci_domain_ok)
 return 0;
 }

+#if !defined(UDEV)
 /**
  * Handles error checking for chown call.
  *
@@ -284,6 +285,7 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
path, errno, strerror(errno));
return -1;
 }
+#endif

 /**
  * Open the DRM device, creating it if necessary.
@@ -303,14 +305,17 @@ static int drmOpenDevice(long dev, int minor, int type)
 stat_t  st;
 charbuf[64];
 int fd;
+#if !defined(UDEV)
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
 int isroot  = !geteuid();
 uid_t   user= DRM_DEV_UID;
 gid_t   group   = DRM_DEV_GID, serv_group;
-
+#endif
+
 sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, 
minor);
 drmMsg("drmOpenDevice: node name is %s\n", buf);

+#if !defined(UDEV)
 if (drm_server_info) {
drm_server_info->get_perms(_group, _mode);
devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
@@ -318,7 +323,6 @@ static int drmOpenDevice(long dev, int minor, int type)
group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
 }

-#if !defined(UDEV)
 if (stat(DRM_DIR_NAME, )) {
if (!isroot)
return DRM_ERR_NOT_ROOT;
@@ -1395,8 +1399,10 @@ drm_context_t *drmGetReservedContextList(int fd, int 
*count)
 }

 res.contexts = list;
-if (drmIoctl(fd, DRM_IOCTL_RES_CTX, ))
+if (drmIoctl(fd, DRM_IOCTL_RES_CTX, )) {
+   drmFree(retval);
return NULL;
+}

 for (i = 0; i < res.count; i++)
retval[i] = list[i].handle;
-- 
1.7.7



[PATCH 3/5] nouveau/nouveau.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 nouveau/nouveau.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 5aa4107..e91287f 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -95,6 +95,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device 
**pdev)
(dev->drm_version <  0x0100 ||
 dev->drm_version >= 0x0200)) {
nouveau_device_del();
+   free(nvdev);
return -EINVAL;
}

@@ -105,6 +106,7 @@ nouveau_device_wrap(int fd, int close, struct 
nouveau_device **pdev)
ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, );
if (ret) {
nouveau_device_del();
+   free(nvdev);
return ret;
}

-- 
1.7.7



[PATCH 2/5] libkms/nouveau.c: Fix a memory leak and cleanup code a bit.

2012-07-13 Thread Johannes Obermayr
---
 libkms/nouveau.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a15..4cbca96 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -94,14 +94,18 @@ nouveau_bo_create(struct kms_driver *kms,
if (!bo)
return -ENOMEM;

-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * height;
-   } else {
+   break;
+   default:
+   free(bo);
return -EINVAL;
}

@@ -114,8 +118,10 @@ nouveau_bo_create(struct kms_driver *kms,
arg.channel_hint = 0;

ret = drmCommandWriteRead(kms->fd, DRM_NOUVEAU_GEM_NEW, , 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }

bo->base.kms = kms;
bo->base.handle = arg.info.handle;
@@ -126,10 +132,6 @@ nouveau_bo_create(struct kms_driver *kms,
*out = >base;

return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }

 static int
-- 
1.7.7



[PATCH 1/5] libkms/intel.c: Fix a memory leak and a dead assignment as well as cleanup code a bit.

2012-07-13 Thread Johannes Obermayr
---
 libkms/intel.c |   25 ++---
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..b8ac343 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -93,14 +93,18 @@ intel_bo_create(struct kms_driver *kms,
if (!bo)
return -ENOMEM;

-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1) & ~(512 - 1);
size = pitch * ((height + 4 - 1) & ~(4 - 1));
-   } else {
+   break;
+   default:
+   free(bo);
return -EINVAL;
}

@@ -108,8 +112,10 @@ intel_bo_create(struct kms_driver *kms,
arg.size = size;

ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_CREATE, , 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }

bo->base.kms = kms;
bo->base.handle = arg.handle;
@@ -124,21 +130,18 @@ intel_bo_create(struct kms_driver *kms,
tile.handle = bo->base.handle;
tile.tiling_mode = I915_TILING_X;
tile.stride = bo->base.pitch;
-
-   ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, 
, sizeof(tile));
 #if 0
+   ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, 
, sizeof(tile));
if (ret) {
kms_bo_destroy(out);
return ret;
}
+#else
+   drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, , 
sizeof(tile));
 #endif
}

return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }

 static int
-- 
1.7.7



libdrm: Fix some warnings reported by clang's scan-build tool

2012-07-13 Thread Johannes Obermayr

Patches 1 to 4 were sent to mesa-dev.


libdrm: Fix some warnings reported by clang's scan-build tool

2012-07-13 Thread Johannes Obermayr

Patches 1 to 4 were sent to mesa-dev.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/5] libkms/nouveau.c: Fix a memory leak and cleanup code a bit.

2012-07-13 Thread Johannes Obermayr
---
 libkms/nouveau.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a15..4cbca96 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -94,14 +94,18 @@ nouveau_bo_create(struct kms_driver *kms,
if (!bo)
return -ENOMEM;
 
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1)  ~(512 - 1);
size = pitch * height;
-   } else {
+   break;
+   default:
+   free(bo);
return -EINVAL;
}
 
@@ -114,8 +118,10 @@ nouveau_bo_create(struct kms_driver *kms,
arg.channel_hint = 0;
 
ret = drmCommandWriteRead(kms-fd, DRM_NOUVEAU_GEM_NEW, arg, 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }
 
bo-base.kms = kms;
bo-base.handle = arg.info.handle;
@@ -126,10 +132,6 @@ nouveau_bo_create(struct kms_driver *kms,
*out = bo-base;
 
return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }
 
 static int
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/5] libkms/intel.c: Fix a memory leak and a dead assignment as well as cleanup code a bit.

2012-07-13 Thread Johannes Obermayr
---
 libkms/intel.c |   25 ++---
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..b8ac343 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -93,14 +93,18 @@ intel_bo_create(struct kms_driver *kms,
if (!bo)
return -ENOMEM;
 
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1)  ~(512 - 1);
size = pitch * ((height + 4 - 1)  ~(4 - 1));
-   } else {
+   break;
+   default:
+   free(bo);
return -EINVAL;
}
 
@@ -108,8 +112,10 @@ intel_bo_create(struct kms_driver *kms,
arg.size = size;
 
ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_CREATE, arg, 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }
 
bo-base.kms = kms;
bo-base.handle = arg.handle;
@@ -124,21 +130,18 @@ intel_bo_create(struct kms_driver *kms,
tile.handle = bo-base.handle;
tile.tiling_mode = I915_TILING_X;
tile.stride = bo-base.pitch;
-
-   ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, 
tile, sizeof(tile));
 #if 0
+   ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, 
tile, sizeof(tile));
if (ret) {
kms_bo_destroy(out);
return ret;
}
+#else
+   drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, tile, 
sizeof(tile));
 #endif
}
 
return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }
 
 static int
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/5] nouveau/nouveau.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 nouveau/nouveau.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 5aa4107..e91287f 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -95,6 +95,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device 
**pdev)
(dev-drm_version   0x0100 ||
 dev-drm_version = 0x0200)) {
nouveau_device_del(dev);
+   free(nvdev);
return -EINVAL;
}
 
@@ -105,6 +106,7 @@ nouveau_device_wrap(int fd, int close, struct 
nouveau_device **pdev)
ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, gart);
if (ret) {
nouveau_device_del(dev);
+   free(nvdev);
return ret;
}
 
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/5] xf86drm.c: Make more code UDEV unrelevant and fix a memory leak.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 6ea068f..e3789c8 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -255,6 +255,7 @@ static int drmMatchBusID(const char *id1, const char *id2, 
int pci_domain_ok)
 return 0;
 }
 
+#if !defined(UDEV)
 /**
  * Handles error checking for chown call.
  *
@@ -284,6 +285,7 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
path, errno, strerror(errno));
return -1;
 }
+#endif
 
 /**
  * Open the DRM device, creating it if necessary.
@@ -303,14 +305,17 @@ static int drmOpenDevice(long dev, int minor, int type)
 stat_t  st;
 charbuf[64];
 int fd;
+#if !defined(UDEV)
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
 int isroot  = !geteuid();
 uid_t   user= DRM_DEV_UID;
 gid_t   group   = DRM_DEV_GID, serv_group;
-
+#endif
+
 sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, 
minor);
 drmMsg(drmOpenDevice: node name is %s\n, buf);
 
+#if !defined(UDEV)
 if (drm_server_info) {
drm_server_info-get_perms(serv_group, serv_mode);
devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
@@ -318,7 +323,6 @@ static int drmOpenDevice(long dev, int minor, int type)
group = (serv_group = 0) ? serv_group : DRM_DEV_GID;
 }
 
-#if !defined(UDEV)
 if (stat(DRM_DIR_NAME, st)) {
if (!isroot)
return DRM_ERR_NOT_ROOT;
@@ -1395,8 +1399,10 @@ drm_context_t *drmGetReservedContextList(int fd, int 
*count)
 }
 
 res.contexts = list;
-if (drmIoctl(fd, DRM_IOCTL_RES_CTX, res))
+if (drmIoctl(fd, DRM_IOCTL_RES_CTX, res)) {
+   drmFree(retval);
return NULL;
+}
 
 for (i = 0; i  res.count; i++)
retval[i] = list[i].handle;
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5/5] modetest.c: Add return 0 in bit_name_fn(res) macro.

2012-07-13 Thread Johannes Obermayr
---
 tests/modetest/modetest.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ec3121e..00129fa 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -128,6 +128,7 @@ char * res##_str(int type) {
\
sep = , ; \
}   \
}   \
+   return 0;   \
 }
 
 static const char *mode_type_names[] = {
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


libdrm: Fix some warnings reported by clang's scan-build tool [try 2]

2012-07-13 Thread Johannes Obermayr

Am Freitag, 13. Juli 2012, 18:47:50 schrieb Marcin Slusarz:
 On Fri, Jul 13, 2012 at 05:49:12PM +0200, Johannes Obermayr wrote:
  
  Patches 1 to 4 were sent to mesa-dev.
 
 And you chose to ignore most of my comments.
 Fine. Don't expect further reviews from me.
 
 Marcin

Patch 1 and 2:
- Adapted
- I want to keep proposed easier to read switch case

Patch 3:
- Resend
- Waiting on your response: 
http://lists.freedesktop.org/archives/mesa-dev/2012-June/023456.html

Patch 4 and 5:
- Splitted
- http://llvm.org/bugs/show_bug.cgi?id=13358 (forgot to split and to add 
'drmFree(list);')
- The 'more if's case' seems better to me

Patch 6:
- Resend

Marcin, not that I ignore comments. But sometimes I want to hear also opinions 
from (some more) other people.
I hope I can calm the waves ...

Johannes
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/6] libkms/intel.c: Fix a memory leak and a dead assignment as well as make some code easier to read.

2012-07-13 Thread Johannes Obermayr
---
 libkms/intel.c |   32 +---
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..12175b0 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -89,27 +89,32 @@ intel_bo_create(struct kms_driver *kms,
}
}
 
-   bo = calloc(1, sizeof(*bo));
-   if (!bo)
-   return -ENOMEM;
-
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1)  ~(512 - 1);
size = pitch * ((height + 4 - 1)  ~(4 - 1));
-   } else {
+   break;
+   default:
return -EINVAL;
}
 
+   bo = calloc(1, sizeof(*bo));
+   if (!bo)
+   return -ENOMEM;
+
memset(arg, 0, sizeof(arg));
arg.size = size;
 
ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_CREATE, arg, 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }
 
bo-base.kms = kms;
bo-base.handle = arg.handle;
@@ -124,21 +129,18 @@ intel_bo_create(struct kms_driver *kms,
tile.handle = bo-base.handle;
tile.tiling_mode = I915_TILING_X;
tile.stride = bo-base.pitch;
-
-   ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, 
tile, sizeof(tile));
 #if 0
+   ret = drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, 
tile, sizeof(tile));
if (ret) {
kms_bo_destroy(out);
return ret;
}
+#else
+   drmCommandWriteRead(kms-fd, DRM_I915_GEM_SET_TILING, tile, 
sizeof(tile));
 #endif
}
 
return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }
 
 static int
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/6] libkms/nouveau.c: Fix a memory leak and make some code easier to read.

2012-07-13 Thread Johannes Obermayr
---
 libkms/nouveau.c |   27 ++-
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a15..fbca6fe 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -90,21 +90,24 @@ nouveau_bo_create(struct kms_driver *kms,
}
}
 
-   bo = calloc(1, sizeof(*bo));
-   if (!bo)
-   return -ENOMEM;
-
-   if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
+   switch (type) {
+   case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
pitch = 64 * 4;
size = 64 * 64 * 4;
-   } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
+   break;
+   case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
pitch = width * 4;
pitch = (pitch + 512 - 1)  ~(512 - 1);
size = pitch * height;
-   } else {
+   break;
+   default:
return -EINVAL;
}
 
+   bo = calloc(1, sizeof(*bo));
+   if (!bo)
+   return -ENOMEM;
+
memset(arg, 0, sizeof(arg));
arg.info.size = size;
arg.info.domain = NOUVEAU_GEM_DOMAIN_MAPPABLE | NOUVEAU_GEM_DOMAIN_VRAM;
@@ -114,8 +117,10 @@ nouveau_bo_create(struct kms_driver *kms,
arg.channel_hint = 0;
 
ret = drmCommandWriteRead(kms-fd, DRM_NOUVEAU_GEM_NEW, arg, 
sizeof(arg));
-   if (ret)
-   goto err_free;
+   if (ret) {
+   free(bo);
+   return ret;
+   }
 
bo-base.kms = kms;
bo-base.handle = arg.info.handle;
@@ -126,10 +131,6 @@ nouveau_bo_create(struct kms_driver *kms,
*out = bo-base;
 
return 0;
-
-err_free:
-   free(bo);
-   return ret;
 }
 
 static int
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/6] nouveau/nouveau.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 nouveau/nouveau.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index 5aa4107..e91287f 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -95,6 +95,7 @@ nouveau_device_wrap(int fd, int close, struct nouveau_device 
**pdev)
(dev-drm_version   0x0100 ||
 dev-drm_version = 0x0200)) {
nouveau_device_del(dev);
+   free(nvdev);
return -EINVAL;
}
 
@@ -105,6 +106,7 @@ nouveau_device_wrap(int fd, int close, struct 
nouveau_device **pdev)
ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, gart);
if (ret) {
nouveau_device_del(dev);
+   free(nvdev);
return ret;
}
 
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/6] xf86drm.c: Make more code UDEV unrelevant.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index 6ea068f..e652731 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -255,6 +255,7 @@ static int drmMatchBusID(const char *id1, const char *id2, 
int pci_domain_ok)
 return 0;
 }
 
+#if !defined(UDEV)
 /**
  * Handles error checking for chown call.
  *
@@ -284,6 +285,7 @@ static int chown_check_return(const char *path, uid_t 
owner, gid_t group)
path, errno, strerror(errno));
return -1;
 }
+#endif
 
 /**
  * Open the DRM device, creating it if necessary.
@@ -303,14 +305,17 @@ static int drmOpenDevice(long dev, int minor, int type)
 stat_t  st;
 charbuf[64];
 int fd;
+#if !defined(UDEV)
 mode_t  devmode = DRM_DEV_MODE, serv_mode;
 int isroot  = !geteuid();
 uid_t   user= DRM_DEV_UID;
 gid_t   group   = DRM_DEV_GID, serv_group;
-
+#endif
+
 sprintf(buf, type ? DRM_DEV_NAME : DRM_CONTROL_DEV_NAME, DRM_DIR_NAME, 
minor);
 drmMsg(drmOpenDevice: node name is %s\n, buf);
 
+#if !defined(UDEV)
 if (drm_server_info) {
drm_server_info-get_perms(serv_group, serv_mode);
devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
@@ -318,7 +323,6 @@ static int drmOpenDevice(long dev, int minor, int type)
group = (serv_group = 0) ? serv_group : DRM_DEV_GID;
 }
 
-#if !defined(UDEV)
 if (stat(DRM_DIR_NAME, st)) {
if (!isroot)
return DRM_ERR_NOT_ROOT;
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5/6] xf86drm.c: Fix two memory leaks.

2012-07-13 Thread Johannes Obermayr
---
 xf86drm.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xf86drm.c b/xf86drm.c
index e652731..c1cc170 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1399,8 +1399,11 @@ drm_context_t *drmGetReservedContextList(int fd, int 
*count)
 }
 
 res.contexts = list;
-if (drmIoctl(fd, DRM_IOCTL_RES_CTX, res))
+if (drmIoctl(fd, DRM_IOCTL_RES_CTX, res)) {
+   drmFree(list);
+   drmFree(retval);
return NULL;
+}
 
 for (i = 0; i  res.count; i++)
retval[i] = list[i].handle;
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/6] modetest.c: Add return 0 in bit_name_fn(res) macro.

2012-07-13 Thread Johannes Obermayr
---
 tests/modetest/modetest.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index ec3121e..00129fa 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -128,6 +128,7 @@ char * res##_str(int type) {
\
sep = , ; \
}   \
}   \
+   return 0;   \
 }
 
 static const char *mode_type_names[] = {
-- 
1.7.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Cannot compile latest drm-radeon-testing against 2.6.34-rc6

2010-05-08 Thread Johannes Obermayr
Hi,

I cannot compile latest drm-radeon-testing against 2.6.34-rc6 on openSUSE.

Johannes
(Please CC me.)



CC [M]  
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/radeon/radeon_pm.o
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/radeon/radeon_pm.c:
 In function 'radeon_pm_init':
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/radeon/radeon_pm.c:430:
 warning: ignoring return value of 'device_create_file', declared with 
attribute warn_unused_result
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/radeon/radeon_pm.c:431:
 warning: ignoring return value of 'device_create_file', declared with 
attribute warn_unused_result
  CC [M]  
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/radeon/atombios_dp.o



  CC [M]  
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/ttm/ttm_page_alloc.o
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/ttm/ttm_page_alloc.c:
 In function 'ttm_set_pages_caching':
/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/ttm/ttm_page_alloc.c:440:
 error: implicit declaration of function 'set_pages_array_wc'
make[5]: *** 
[/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/ttm/ttm_page_alloc.o]
 Error 1
make[4]: *** 
[/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm/ttm] 
Error 2
make[3]: *** 
[/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default/drm] Error 2
make[2]: *** 
[_module_/usr/src/packages/BUILD/drm-testing-20100508/drm-all/obj/default] 
Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
make: Leaving directory `/usr/src/linux-2.6.34-rc6-29-obj/i386/default'
error: Bad exit status from /var/tmp/rpm-tmp.9hZXBd (%build)