[Nouveau] [Bug 28212] image corruption

2010-05-23 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=28212

--- Comment #6 from Martin Peres martin.pe...@ensi-bourges.fr 2010-05-23 
02:05:50 PDT ---
okias: Can you try to activate the image preview in dolphin ?

If all you get is scrambled thumbnails, then, you have found a good way to
reproduce this issue.

Now, let's find what's happening.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH] drm/nouveau: Add getparam for current PTIMER time.

2010-05-23 Thread Marcin Kościelnicki
This will be useful for computing GPU-CPU latency, including
GL_ARB_timer_query extension.

Signed-off-by: Marcin Kościelnicki koria...@0x04.net
---
 drivers/gpu/drm/nouveau/nouveau_state.c |3 +++
 include/drm/nouveau_drm.h   |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c 
b/drivers/gpu/drm/nouveau/nouveau_state.c
index e171064..3499de3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -859,6 +859,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void 
*data,
case NOUVEAU_GETPARAM_VM_VRAM_BASE:
getparam-value = dev_priv-vm_vram_base;
break;
+   case NOUVEAU_GETPARAM_PTIMER_TIME:
+   getparam-value = nv04_timer_read(dev);
+   break;
case NOUVEAU_GETPARAM_GRAPH_UNITS:
/* NV40 and NV50 versions are quite different, but register
 * address is the same. User is supposed to know the card
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index 5792feb..6589261 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free {
 #define NOUVEAU_GETPARAM_CHIPSET_ID  11
 #define NOUVEAU_GETPARAM_VM_VRAM_BASE12
 #define NOUVEAU_GETPARAM_GRAPH_UNITS 13
+#define NOUVEAU_GETPARAM_PTIMER_TIME 14
 struct drm_nouveau_getparam {
uint64_t param;
uint64_t value;
-- 
1.7.0.2

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH v2] drm/nouveau: Add getparam for current PTIMER time.

2010-05-23 Thread Marcin Kościelnicki
This will be useful for computing GPU-CPU latency, including
GL_ARB_timer_query extension.

Signed-off-by: Marcin Kościelnicki koria...@0x04.net
---
 drivers/gpu/drm/nouveau/nouveau_state.c |3 +++
 include/drm/nouveau_drm.h   |1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c 
b/drivers/gpu/drm/nouveau/nouveau_state.c
index e171064..b793880 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -859,6 +859,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void 
*data,
case NOUVEAU_GETPARAM_VM_VRAM_BASE:
getparam-value = dev_priv-vm_vram_base;
break;
+   case NOUVEAU_GETPARAM_PTIMER_TIME:
+   getparam-value = dev_priv-engine.timer.read(dev);
+   break;
case NOUVEAU_GETPARAM_GRAPH_UNITS:
/* NV40 and NV50 versions are quite different, but register
 * address is the same. User is supposed to know the card
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
index 5792feb..6589261 100644
--- a/include/drm/nouveau_drm.h
+++ b/include/drm/nouveau_drm.h
@@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free {
 #define NOUVEAU_GETPARAM_CHIPSET_ID  11
 #define NOUVEAU_GETPARAM_VM_VRAM_BASE12
 #define NOUVEAU_GETPARAM_GRAPH_UNITS 13
+#define NOUVEAU_GETPARAM_PTIMER_TIME 14
 struct drm_nouveau_getparam {
uint64_t param;
uint64_t value;
-- 
1.7.0.2

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


[Nouveau] [PATCH] nv: improve KMS detection

2010-05-23 Thread Marcin Slusarz
1) DRICreatePCIBusID belongs to xserver dri module, so when it's
   unavailable we can't format string for drmCheckModesettingSupported.
   (This situation happened to me with KMS enabled and dri module moved
   somewhere else by Gentoo's eselect opengl set nvidia switcher)
   Open code DRICreatePCIBusID to drop dri dependency.
2) Once we dropped dependency on dri module (which linked to libdrm),
   we have to link directly to libdrm.

Signed-off-by: Marcin Slusarz marcin.slus...@gmail.com
---
 src/Makefile.am |2 +-
 src/nv_driver.c |   11 +++
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 5d57010..8b23e21 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,7 +25,7 @@
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 AM_CFLAGS = @XMODES_CFLAGS@ @XORG_CFLAGS@ $(LIBDRM_CFLAGS)
 nv_drv_la_LTLIBRARIES = nv_drv.la
-nv_drv_la_LDFLAGS = -module -avoid-version
+nv_drv_la_LDFLAGS = -module -avoid-version $(LIBDRM_LIBS)
 nv_drv_ladir = @moduledir@/drivers
 
 nv_drv_la_SOURCES = $(nv_sources) $(riva_sources) $(g80_sources)
diff --git a/src/nv_driver.c b/src/nv_driver.c
index e10ae0c..6651cd4 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -836,18 +836,13 @@ NVIsSupported(CARD32 id)
 }
 
 #ifdef HAVE_KMS
-static Bool NVKernelModesettingEnabled(struct pci_device *device)
+static Bool NVKernelModesettingEnabled(struct pci_device *dev)
 {
-char *busIdString;
+char busIdString[20];
 int ret;
 
-if (!xf86LoaderCheckSymbol(DRICreatePCIBusID))
-return FALSE;
-
-busIdString = DRICreatePCIBusID(device);
-
+snprintf(busIdString, 20, pci:%04x:%02x:%02x.%d, dev-domain, dev-bus, 
dev-dev, dev-func);
 ret = drmCheckModesettingSupported(busIdString);
-xfree(busIdString);
 
 return (ret == 0);
 }
-- 
1.7.1

___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH] nv: improve KMS detection

2010-05-23 Thread Ben Skeggs
On Sun, 2010-05-23 at 21:46 +0200, Marcin Slusarz wrote:
 1) DRICreatePCIBusID belongs to xserver dri module, so when it's
unavailable we can't format string for drmCheckModesettingSupported.
(This situation happened to me with KMS enabled and dri module moved
somewhere else by Gentoo's eselect opengl set nvidia switcher)
Open code DRICreatePCIBusID to drop dri dependency.
 2) Once we dropped dependency on dri module (which linked to libdrm),
we have to link directly to libdrm.
An alternative, which we use in Fedora for nv/vesa is to use
pci_device_has_kernel_driver() from libpciaccess.

Ben.

 
 Signed-off-by: Marcin Slusarz marcin.slus...@gmail.com
 ---
  src/Makefile.am |2 +-
  src/nv_driver.c |   11 +++
  2 files changed, 4 insertions(+), 9 deletions(-)
 
 diff --git a/src/Makefile.am b/src/Makefile.am
 index 5d57010..8b23e21 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -25,7 +25,7 @@
  # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
  AM_CFLAGS = @XMODES_CFLAGS@ @XORG_CFLAGS@ $(LIBDRM_CFLAGS)
  nv_drv_la_LTLIBRARIES = nv_drv.la
 -nv_drv_la_LDFLAGS = -module -avoid-version
 +nv_drv_la_LDFLAGS = -module -avoid-version $(LIBDRM_LIBS)
  nv_drv_ladir = @moduledir@/drivers
  
  nv_drv_la_SOURCES = $(nv_sources) $(riva_sources) $(g80_sources)
 diff --git a/src/nv_driver.c b/src/nv_driver.c
 index e10ae0c..6651cd4 100644
 --- a/src/nv_driver.c
 +++ b/src/nv_driver.c
 @@ -836,18 +836,13 @@ NVIsSupported(CARD32 id)
  }
  
  #ifdef HAVE_KMS
 -static Bool NVKernelModesettingEnabled(struct pci_device *device)
 +static Bool NVKernelModesettingEnabled(struct pci_device *dev)
  {
 -char *busIdString;
 +char busIdString[20];
  int ret;
  
 -if (!xf86LoaderCheckSymbol(DRICreatePCIBusID))
 -return FALSE;
 -
 -busIdString = DRICreatePCIBusID(device);
 -
 +snprintf(busIdString, 20, pci:%04x:%02x:%02x.%d, dev-domain, 
 dev-bus, dev-dev, dev-func);
  ret = drmCheckModesettingSupported(busIdString);
 -xfree(busIdString);
  
  return (ret == 0);
  }


___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [PATCH v2] drm/nouveau: Add getparam for current PTIMER time.

2010-05-23 Thread Ben Skeggs
On Sun, 2010-05-23 at 11:36 +, Marcin Kościelnicki wrote:
 This will be useful for computing GPU-CPU latency, including
 GL_ARB_timer_query extension.
Looks fine, just a quick question as to whether this is necessary?  I
seem to recall that on nv40, the QUERY methods actually return
timestamps in the notifier that one would assume are from PTIMER.

Is there some way to do this on G80+ also?

Ben.

 
 Signed-off-by: Marcin Kościelnicki koria...@0x04.net
 ---
  drivers/gpu/drm/nouveau/nouveau_state.c |3 +++
  include/drm/nouveau_drm.h   |1 +
  2 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c 
 b/drivers/gpu/drm/nouveau/nouveau_state.c
 index e171064..b793880 100644
 --- a/drivers/gpu/drm/nouveau/nouveau_state.c
 +++ b/drivers/gpu/drm/nouveau/nouveau_state.c
 @@ -859,6 +859,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void 
 *data,
   case NOUVEAU_GETPARAM_VM_VRAM_BASE:
   getparam-value = dev_priv-vm_vram_base;
   break;
 + case NOUVEAU_GETPARAM_PTIMER_TIME:
 + getparam-value = dev_priv-engine.timer.read(dev);
 + break;
   case NOUVEAU_GETPARAM_GRAPH_UNITS:
   /* NV40 and NV50 versions are quite different, but register
* address is the same. User is supposed to know the card
 diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h
 index 5792feb..6589261 100644
 --- a/include/drm/nouveau_drm.h
 +++ b/include/drm/nouveau_drm.h
 @@ -79,6 +79,7 @@ struct drm_nouveau_gpuobj_free {
  #define NOUVEAU_GETPARAM_CHIPSET_ID  11
  #define NOUVEAU_GETPARAM_VM_VRAM_BASE12
  #define NOUVEAU_GETPARAM_GRAPH_UNITS 13
 +#define NOUVEAU_GETPARAM_PTIMER_TIME 14
  struct drm_nouveau_getparam {
   uint64_t param;
   uint64_t value;


___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau