drm/i915/ringbuffer: set force wake bit before reading ring register
Subsystems (2)
PATCH 1/1 drm/i915/ringbuffer: set force wake bit before reading ring register
before reading ring register, set force wake bit to prevent GT core power down to low power state. otherwise we may read stale value.
--- drivers/gpu/drm/i915/i915_drv.h | 14 ++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_ringbuffer.c | 3 --- drivers/gpu/drm/i915/intel_ringbuffer.h | 11 +++++++---- 4 files changed, 22 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +14 -0
@@ -1325,4 +1325,18 @@ static inline void i915_write(struct drm_i915_private *dev_priv, u32 reg,#define PRIMARY_RINGBUFFER_SIZE (128*1024) +/* on SNB platform, +before reading ring registers forcewake bit +must be set to prevent GT core from power down +*/ + +static inline u32 i915_safe_read (struct intel_ring_buffer *ring, +unsigned int offset) +{ +u32 ret; +drm_i915_private_t *dev_priv = ring->dev->dev_private; +if (IS_GEN6 (ring->dev))I915_WRITE (FORCEWAKE ,1 ); + ret =I915_READ (offset); +return ret; +}#endif
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -3052,4 +3052,5 @@#define EDP_LINK_TRAIN_800MV_0DB_SNB_B (0x38<<22)#define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) +#define FORCEWAKE 0xA18C#endif /* _I915_REG_H_ */
drivers/gpu/drm/i915/intel_ringbuffer.c +0 -3
@@ -572,7 +572,6 @@ err:int intel_init_ring_buffer (struct drm_device *dev,struct intel_ring_buffer *ring) { -struct drm_i915_private *dev_priv = dev->dev_private;struct drm_i915_gem_object *obj_priv;struct drm_gem_object *obj;int ret;
@@ -691,8 +690,6 @@ int intel_wait_ring_buffer(struct drm_device *dev, struct intel_ring_buffer *ring, int n) {unsigned long end; -drm_i915_private_t *dev_priv = dev->dev_private; -trace_i915_ring_wait_begin (dev); end = jiffies +3 *HZ ; do {
drivers/gpu/drm/i915/intel_ringbuffer.h +7 -4
@@ -7,13 +7,16 @@ struct intel_hw_status_page {struct drm_gem_object *obj; }; -#define I915_READ_TAIL (ring) I915_READ(RING_TAIL(ring->mmio_base)) +#define I915_READ_TAIL (ring) i915_safe_read(ring, RING_TAIL(ring->mmio_base))#define I915_WRITE_TAIL (ring, val) I915_WRITE(RING_TAIL(ring->mmio_base), val) -#define I915_READ_START (ring) I915_READ(RING_START(ring->mmio_base)) + +#define I915_READ_START (ring) i915_safe_read(ring, RING_START(ring->mmio_base))#define I915_WRITE_START (ring, val) I915_WRITE(RING_START(ring->mmio_base), val) -#define I915_READ_HEAD (ring) I915_READ(RING_HEAD(ring->mmio_base)) + +#define I915_READ_HEAD (ring) i915_safe_read(ring, RING_HEAD(ring->mmio_base))#define I915_WRITE_HEAD (ring, val) I915_WRITE(RING_HEAD(ring->mmio_base), val) -#define I915_READ_CTL (ring) I915_READ(RING_CTL(ring->mmio_base)) + +#define I915_READ_CTL (ring) i915_safe_read(ring, RING_CTL(ring->mmio_base))#define I915_WRITE_CTL (ring, val) I915_WRITE(RING_CTL(ring->mmio_base), val)struct drm_i915_gem_execbuffer2 ;
Signature · 1 line
1.7.1
Quoted 110 lines
Quoted 110 lines
-----Original Message-----
From: Zou, Nanhai
Sent: 2010年11月9日 17:18
To: [email protected]; Chris Wilson
Cc: Zou, Nanhai
Subject: [PATCH] drm/i915/ringbuffer: set force wake bit before reading ring registerbefore reading ring register, set force wake bit to prevent GT core power down to low power state. otherwise we may read stale value.
Signed-off-by Zou Nan hai <[email protected]>---
drivers/gpu/drm/i915/i915_drv.h | 14 ++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_ringbuffer.c | 3 --- drivers/gpu/drm/i915/intel_ringbuffer.h | 11 +++++++---- 4 files changed, 22 insertions(+), 7 deletions(-)drivers/gpu/drm/i915/i915_drv.h +14
-0@@ -1325,4 +1325,18 @@ static inline void i915_write(struct drm_i915_private *dev_priv, u32 reg,#define PRIMARY_RINGBUFFER_SIZE (128*1024) +/* on SNB platform, +before reading ring registers forcewake bit +must be set to prevent GT core from power down +*/ + +static inline u32 i915_safe_read (struct intel_ring_buffer *ring, +unsigned int offset) +{ +u32 ret; +drm_i915_private_t *dev_priv = ring->dev->dev_private; +if (IS_GEN6 (ring->dev))I915_WRITE (FORCEWAKE ,1 ); + ret =I915_READ (offset); +return ret; +}#endif
drivers/gpu/drm/i915/i915_reg.h +1
-0@@ -3052,4 +3052,5 @@#define EDP_LINK_TRAIN_800MV_0DB_SNB_B (0x38<<22)#define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) +#define FORCEWAKE 0xA18C#endif /* _I915_REG_H_ */ drivers/gpu/drm/i915/intel_ringbuffer.c +0
-3@@ -572,7 +572,6 @@ err:int intel_init_ring_buffer (struct drm_device *dev,struct intel_ring_buffer *ring) { -struct drm_i915_private *dev_priv = dev->dev_private;struct drm_i915_gem_object *obj_priv;struct drm_gem_object *obj;int ret;@@ -691,8 +690,6 @@ int intel_wait_ring_buffer(struct drm_device *dev, struct intel_ring_buffer *ring, int n) {unsigned long end; -drm_i915_private_t *dev_priv = dev->dev_private; -trace_i915_ring_wait_begin (dev); end = jiffies +3 *HZ ; do {drivers/gpu/drm/i915/intel_ringbuffer.h +5
-3@@ -7,13 +7,16 @@ struct intel_hw_status_page {struct drm_gem_object *obj; }; -#define I915_READ_TAIL (ring) I915_READ(RING_TAIL(ring->mmio_base)) +#define I915_READ_TAIL (ring) i915_safe_read(ring, RING_TAIL(ring->mmio_base))#define I915_WRITE_TAIL (ring, val) I915_WRITE(RING_TAIL(ring->mmio_base), val) -#define I915_READ_START (ring) I915_READ(RING_START(ring->mmio_base)) + +#define I915_READ_START (ring) i915_safe_read(ring, RING_START(ring->mmio_base))#define I915_WRITE_START (ring, val) I915_WRITE(RING_START(ring->mmio_base), val) -#define I915_READ_HEAD (ring) I915_READ(RING_HEAD(ring->mmio_base)) + +#define I915_READ_HEAD (ring) i915_safe_read(ring, RING_HEAD(ring->mmio_base))#define
I915_WRITE_HEAD(ring, val)I915_WRITE(RING_HEAD(ring->mmio_base), val)drivers/gpu/drm/i915/intel_ringbuffer.h +2
-1-#define I915_READ_CTL (ring) I915_READ(RING_CTL(ring->mmio_base)) + +#define I915_READ_CTL (ring) i915_safe_read(ring,
RING_CTL(ring->mmio_base))
#defineI915_WRITE_CTL(ring, val)I915_WRITE(RING_CTL(ring->mmio_base), val)
Quoted 3 lines
Quoted 3 lines
struct
drm_i915_gem_execbuffer2;
--
1.7.1
I have tested this patch with the read ring head from status page workaround patch reverted. Seems it works on my SNB box.
Thanks
Zou Nanhai
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Nanhai
I have tested this patch with the read ring head from status page workaround patch reverted. Seems it works on my SNB box.
I needed to add a udelay(100) to i915_safe_read for my rev 8. Can you check if there is a recommended delay for FORCEWAKE? -Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 9 lines
Quoted 9 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: 2010年11月9日 18:50
To: Zou, Nanhai; [email protected]; Zhao, Jian J
Subject: RE: [PATCH] drm/i915/ringbuffer: set force wake bit before reading ring registerOn Tue, 9 Nov 2010 17:17:07 +0800, "Zou, Nanhai" <[email protected]> wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
I have tested this patch with the read ring head from status page workaround
patch reverted.
Quoted 1 line
Seems it works on my SNB box.
I needed to add a udelay(100) to
i915_safe_readfor my rev 8. Can you check if there is a recommended delay for FORCEWAKE? -Chris
Dose a post read to FORCEWAKE help?
Thanks
Zou Nanhai
Quoted 2 lines
Quoted 2 lines
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Nanhai
Quoted 10 lines
Quoted 10 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: 2010年11月9日 18:50
To: Zou, Nanhai; [email protected]; Zhao, Jian J
Subject: RE: [PATCH] drm/i915/ringbuffer: set force wake bit before reading ring registerQuoted 1 line · Nanhai
I have tested this patch with the read ring head from status page workaround
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
patch reverted.
Quoted 1 line
Seems it works on my SNB box.
I needed to add a udelay(100) to
i915_safe_readfor my rev 8. Can you check if there is a recommended delay for FORCEWAKE? -ChrisDose a post read to FORCEWAKE help?
No, tried a POSTING_READ(FORCEWAKE) first and it wasn't until I added the udelay() between the READ(FORCEWAKE) and the READ(reg) that it returned the correct results in a single call.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 21 lines · On Wed, 10 Nov 2010 07:54:12 +0000 Chris Wilson <[email protected]>…
Quoted 19 lines · Nanhai
Quoted 19 lines
Quoted 19 lines
-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: 2010年11月9日 18:50
To: Zou, Nanhai; [email protected]; Zhao, Jian J
Subject: RE: [PATCH] drm/i915/ringbuffer: set force wake bit before reading ring registerQuoted 2 lines · Nanhai
I have tested this patch with the read ring head from status page workaround
patch reverted.
Quoted 1 line
Seems it works on my SNB box.
I needed to add a udelay(100) to
i915_safe_readfor my rev 8. Can you check if there is a recommended delay for FORCEWAKE? -Chris
Quoted 5 lines
Quoted 1 line
Dose a post read to FORCEWAKE help?
No, tried a
POSTING_READ(FORCEWAKE)first and it wasn't until I added theudelay()between the READ(FORCEWAKE) and the READ(reg) that it returned the correct results in a single call.
I think these regs will be affected by the ucode on the GPU; we may need specific delays after some operations. Have you tried asking the hw guys what the best practices are here?
Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
(no subject)
Hi folks,
I am a bit new to graphics, but had a few questions that I was hoping that someone could answer for me. I hope this is the right forum to ask these questions. My interest is in seeing whether I can use the Intel integrated graphics part for non-graphics (GPGPU) work, while driving the display through another discrete card. I have an Ironlake system (core setup with base Debian (no X-related packages), a basic PCI-E graphics card (NVIDIA NV37GL) and a 2.6.36 kernel with the following relevant config entries.
CONFIG_AGP=yCONFIG_AGP_AMD64=yCONFIG_AGP_INTEL=yCONFIG_VGA_ARB=yCONFIG_VGA_ARB_MAX_GPUS=16
# CONFIG_VGA_SWITCHEROO is not setCONFIG_DRM=mCONFIG_DRM_KMS_HELPER=mCONFIG_DRM_TTM=mCONFIG_DRM_R128=mCONFIG_DRM_I810=mCONFIG_DRM_I830=mCONFIG_DRM_I915=mCONFIG_DRM_I915_KMS=y
I have libdrm & libva installed, and was hoping to use libdrm APIs to do some basic operations on the integrated graphics.
I can insmod the DRM & the DRM_KMS_HELPER module fine, but when trying to insert the I915 driver, I get a "no such device error", even though the module object exists.
lspci doesn't seem to return the Intel integrated graphics PCI device either.
00:00.0 Host bridge: Intel Corporation Auburndale/Havendale DRAM Controller (rev 02) 00:01.0 PCI bridge: Intel Corporation Auburndale/Havendale PCI Express x16 Root Port (rev 02) 00:16.0 Communication controller: Intel Corporation Ibex Peak HECI Controller (rev 06) 00:16.2 IDE interface: Intel Corporation Ibex Peak PT IDER Controller (rev 06) 00:16.3 Serial controller: Intel Corporation Ibex Peak KT Controller (rev 06) 00:19.0 Ethernet controller: Intel Corporation Device 10f0 (rev 06)
00:1a.0 USB Controller: Intel Corporation Ibex Peak USB2 Enhanced Host Controller (rev 06) 00:1b.0 Audio device: Intel Corporation Ibex Peak High Definition Audio (rev 06) 00:1d.0 USB Controller: Intel Corporation Ibex Peak USB2 Enhanced Host Controller (rev 06) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation Ibex Peak LPC Interface Controller (rev 06) 00:1f.2 SATA controller: Intel Corporation Ibex Peak 6 port SATA AHCI Controller (rev 06) 00:1f.3 SMBus: Intel Corporation Ibex Peak SMBus Controller (rev 06)
01:00.0 VGA compatible controller: nVidia Corporation NV37GL [Quadro PCI-E Series] (rev a2) 02:02.0 Ethernet controller: Intel Corporation 82557/8/9/0/1 Ethernet Pro 100 (rev 08)
First off, is there a way for the Intel integrated graphics to appear in the list of PCI devices when it's not being used for driving the display? Secondly, can I simply use the libdrm APIs to directly perform operations on the Intel integrated part? Does there exist any documentation describing the DRM APIs? Finally, can I use the DRM APIs for using the GPU "media pipe" (architecturally different from the 3D graphics pipe)?
Thanks,
Hari