drm/i915: Fix BDW sprite colors and a few cleanups
Subsystems (2)
cover drm/i915: Fix BDW sprite colors and a few cleanups
From: Ville Syrjälä <[email protected]>
This series fixes the "colors are wrong with YCbCr sprites" bug on BDW, and avoids some other bugs that would happend when someone enables FBC on BDW.
Ville Syrjälä (3):
drm/i915: Don't clobber CHICKEN_PIPESL_1 on BDW drm/i915: Use RMW to update chicken bits in gen7_enable_fbc() drm/i915: Unify CHICKEN_PIPESL_1 register definitions
drivers/gpu/drm/i915/i915_reg.h | 10 ++-------- drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++------ 2 files changed, 11 insertions(+), 14 deletions(-)
Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/3 drm/i915: Don't clobber CHICKEN_PIPESL_1 on BDW
From: Ville Syrjälä <[email protected]>
Misplaced parens cause us to totally clobber the CHICKEN_PIPESL_1 registers with 0xffffffff. Move the parens to the correct place to avoid this.
In particular this caused bit 30 of said registers to be set, which caused the sprite CSC to produce incorrect results.
Cc: [email protected]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72220
--- drivers/gpu/drm/i915/intel_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -2
@@ -4832,8 +4832,8 @@ static void gen8_init_clock_gating(struct drm_device *dev)/* WaPsrDPRSUnmaskVBlankInSRD:bdw */ for_each_pipe (i) {I915_WRITE (CHICKEN_PIPESL_1 (i), -I915_READ (CHICKEN_PIPESL_1 (i) | -DPRS_MASK_VBLANK_SRD )); +I915_READ (CHICKEN_PIPESL_1 (i)) | +DPRS_MASK_VBLANK_SRD ); }/* Use Force Non-Coherent whenever executing a 3D context. This is a
Signature · 1 line
1.8.3.2
Re: [PATCH 1/3] drm/i915: Don't clobber CHICKEN_PIPESL_1 on BDW
Quoted 6 lines · On Wed, Mar 05, 2014 at 01:05:45PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Misplaced parens cause us to totally clobber the
CHICKEN_PIPESL_1registers with0xffffffff. Move the parens to the correct place to avoid this.
Quoted 6 lines
In particular this caused bit 30 of said registers to be set, which caused the sprite CSC to produce incorrect results.
Cc: [email protected]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72220Signed-off-by Ville Syrjälä <[email protected]>
Signature · 1 line
Damien
Quoted 26 lines
--- drivers/gpu/drm/i915/intel_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_pm.c +2
-2@@ -4832,8 +4832,8 @@ static void gen8_init_clock_gating(struct drm_device *dev)/* WaPsrDPRSUnmaskVBlankInSRD:bdw */ for_each_pipe (i) {I915_WRITE (CHICKEN_PIPESL_1 (i), -I915_READ (CHICKEN_PIPESL_1 (i) | -DPRS_MASK_VBLANK_SRD )); +I915_READ (CHICKEN_PIPESL_1 (i)) | +DPRS_MASK_VBLANK_SRD ); }/* Use Force Non-Coherent whenever executing a 3D context. This is a Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 drm/i915: Use RMW to update chicken bits in gen7_enable_fbc()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
gen7_enable_fbc() may write to some registers which we've already touched, so use RMW so that we don't undo any previous updates.
Also note that we implemnt WaFbcAsynchFlipDisableFbcQueue:bdw.
--- drivers/gpu/drm/i915/intel_pm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +5 -2
@@ -294,10 +294,13 @@ static void gen7_enable_fbc(struct drm_crtc *crtc)if (IS_IVYBRIDGE (dev)) {/* WaFbcAsynchFlipDisableFbcQueue:ivb */ -I915_WRITE (ILK_DISPLAY_CHICKEN1 ,ILK_FBCQ_DIS ); +I915_WRITE (ILK_DISPLAY_CHICKEN1 , +I915_READ (ILK_DISPLAY_CHICKEN1 ) | +ILK_FBCQ_DIS ); }else { -/* WaFbcAsynchFlipDisableFbcQueue:hsw */ +/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ I915_WRITE (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe), +I915_READ (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe)) |HSW_BYPASS_FBC_QUEUE ); }
Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/3] drm/i915: Use RMW to update chicken bits in gen7_enable_fbc()
Quoted 8 lines · On Wed, Mar 05, 2014 at 01:05:46PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
gen7_enable_fbc()may write to some registers which we've already touched, so use RMW so that we don't undo any previous updates.Also note that we implemnt WaFbcAsynchFlipDisableFbcQueue:bdw.
Signed-off-by Ville Syrjälä <[email protected]>
Signature · 1 line
Damien
Quoted 31 lines
--- drivers/gpu/drm/i915/intel_pm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_pm.c +5
-2@@ -294,10 +294,13 @@ static void gen7_enable_fbc(struct drm_crtc *crtc)if (IS_IVYBRIDGE (dev)) {/* WaFbcAsynchFlipDisableFbcQueue:ivb */ -I915_WRITE (ILK_DISPLAY_CHICKEN1 ,ILK_FBCQ_DIS ); +I915_WRITE (ILK_DISPLAY_CHICKEN1 , +I915_READ (ILK_DISPLAY_CHICKEN1 ) | +ILK_FBCQ_DIS ); }else { -/* WaFbcAsynchFlipDisableFbcQueue:hsw */ +/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ I915_WRITE (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe), +I915_READ (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe)) |HSW_BYPASS_FBC_QUEUE ); }Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/3] drm/i915: Use RMW to update chicken bits in gen7_enable_fbc()
In reply to [email protected]Quoted 8 lines · On Wed, Mar 05, 2014 at 01:05:46PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
gen7_enable_fbc()may write to some registers which we've already touched, so use RMW so that we don't undo any previous updates.Also note that we implemnt WaFbcAsynchFlipDisableFbcQueue:bdw.
Signed-off-by Ville Syrjälä <[email protected]>
CC stable?
Quoted 31 lines
--- drivers/gpu/drm/i915/intel_pm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_pm.c +5
-2@@ -294,10 +294,13 @@ static void gen7_enable_fbc(struct drm_crtc *crtc)if (IS_IVYBRIDGE (dev)) {/* WaFbcAsynchFlipDisableFbcQueue:ivb */ -I915_WRITE (ILK_DISPLAY_CHICKEN1 ,ILK_FBCQ_DIS ); +I915_WRITE (ILK_DISPLAY_CHICKEN1 , +I915_READ (ILK_DISPLAY_CHICKEN1 ) | +ILK_FBCQ_DIS ); }else { -/* WaFbcAsynchFlipDisableFbcQueue:hsw */ +/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ I915_WRITE (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe), +I915_READ (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe)) |HSW_BYPASS_FBC_QUEUE ); }Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915: Unify CHICKEN_PIPESL_1 register definitions
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We have two names for the same register CHICKEN_PIPESL_1 and HSW_PIPE_SLICE_CHICKEN_1. Unify it to just one.
Also rename the FBCQ disable bit to resemble the name we've given to a similar bit on earlier platforms.
--- drivers/gpu/drm/i915/i915_reg.h | 10 ++-------- drivers/gpu/drm/i915/intel_pm.c | 8 ++++---- 2 files changed, 6 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -8
@@ -1126,13 +1126,6 @@#define FBC_REND_NUKE (1<<2)#define FBC_REND_CACHE_CLEAN (1<<1) -#define _HSW_PIPE_SLICE_CHICKEN_1_A 0x420B0 -#define _HSW_PIPE_SLICE_CHICKEN_1_B 0x420B4 -#define HSW_BYPASS_FBC_QUEUE (1<<22) -#define HSW_PIPE_SLICE_CHICKEN_1 (pipe) _PIPE(pipe, + \ - _HSW_PIPE_SLICE_CHICKEN_1_A, + \ - _HSW_PIPE_SLICE_CHICKEN_1_B) -/* * GPIO regs */
@@ -4145,7 +4138,8 @@#define _CHICKEN_PIPESL_1_A 0x420b0#define _CHICKEN_PIPESL_1_B 0x420b4 -#define DPRS_MASK_VBLANK_SRD (1 << 0) +#define HSW_FBCQ_DIS (1 << 22) +#define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)#define CHICKEN_PIPESL_1 (pipe) _PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B)#define DISP_ARB_CTL 0x45000
drivers/gpu/drm/i915/intel_pm.c +4 -4
@@ -299,9 +299,9 @@ static void gen7_enable_fbc(struct drm_crtc *crtc) ILK_FBCQ_DIS); }else {/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ -I915_WRITE (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe), -I915_READ (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe)) | -HSW_BYPASS_FBC_QUEUE ); +I915_WRITE (CHICKEN_PIPESL_1 (intel_crtc->pipe), +I915_READ (CHICKEN_PIPESL_1 (intel_crtc->pipe)) | +HSW_FBCQ_DIS ); } I915_WRITE(SNB_DPFC_CTL_SA,
@@ -4836,7 +4836,7 @@ static void gen8_init_clock_gating(struct drm_device *dev)for_each_pipe (i) {I915_WRITE (CHICKEN_PIPESL_1 (i),I915_READ (CHICKEN_PIPESL_1 (i)) | -DPRS_MASK_VBLANK_SRD ); +BDW_DPRS_MASK_VBLANK_SRD ); }/* Use Force Non-Coherent whenever executing a 3D context. This is a
Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915: Unify CHICKEN_PIPESL_1 register definitions
Quoted 9 lines · On Wed, Mar 05, 2014 at 01:05:47PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We have two names for the same register
CHICKEN_PIPESL_1andHSW_PIPE_SLICE_CHICKEN_1. Unify it to just one.Also rename the FBCQ disable bit to resemble the name we've given to a similar bit on earlier platforms.
Signed-off-by Ville Syrjälä <[email protected]>
Signature · 1 line
Damien
Quoted 66 lines
--- drivers/gpu/drm/i915/i915_reg.h | 10 ++-------- drivers/gpu/drm/i915/intel_pm.c | 8 ++++---- 2 files changed, 6 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/i915_reg.h +2
-8@@ -1126,13 +1126,6 @@#define FBC_REND_NUKE (1<<2)#define FBC_REND_CACHE_CLEAN (1<<1) -#define _HSW_PIPE_SLICE_CHICKEN_1_A 0x420B0 -#define _HSW_PIPE_SLICE_CHICKEN_1_B 0x420B4 -#define HSW_BYPASS_FBC_QUEUE (1<<22) -#define HSW_PIPE_SLICE_CHICKEN_1 (pipe) _PIPE(pipe, + \ - _HSW_PIPE_SLICE_CHICKEN_1_A, + \ - _HSW_PIPE_SLICE_CHICKEN_1_B) -/* * GPIO regs */ @@ -4145,7 +4138,8 @@#define _CHICKEN_PIPESL_1_A 0x420b0#define _CHICKEN_PIPESL_1_B 0x420b4 -#define DPRS_MASK_VBLANK_SRD (1 << 0) +#define HSW_FBCQ_DIS (1 << 22) +#define BDW_DPRS_MASK_VBLANK_SRD (1 << 0)#define CHICKEN_PIPESL_1 (pipe) _PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B)#define DISP_ARB_CTL 0x45000drivers/gpu/drm/i915/intel_pm.c +4
-4@@ -299,9 +299,9 @@ static void gen7_enable_fbc(struct drm_crtc *crtc) ILK_FBCQ_DIS); }else {/* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ -I915_WRITE (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe), -I915_READ (HSW_PIPE_SLICE_CHICKEN_1 (intel_crtc->pipe)) | -HSW_BYPASS_FBC_QUEUE ); +I915_WRITE (CHICKEN_PIPESL_1 (intel_crtc->pipe), +I915_READ (CHICKEN_PIPESL_1 (intel_crtc->pipe)) | +HSW_FBCQ_DIS ); } I915_WRITE(SNB_DPFC_CTL_SA,@@ -4836,7 +4836,7 @@ static void gen8_init_clock_gating(struct drm_device *dev)for_each_pipe (i) {I915_WRITE (CHICKEN_PIPESL_1 (i),I915_READ (CHICKEN_PIPESL_1 (i)) | -DPRS_MASK_VBLANK_SRD ); +BDW_DPRS_MASK_VBLANK_SRD ); }/* Use Force Non-Coherent whenever executing a 3D context. This is a Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH 3/3] drm/i915: Unify CHICKEN_PIPESL_1 register definitions
Quoted 6 lines · Damien Lespiau
Quoted 5 lines · On Wed, Mar 05, 2014 at 01:05:47PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
We have two names for the same register
CHICKEN_PIPESL_1andHSW_PIPE_SLICE_CHICKEN_1. Unify it to just one.
Quoted 6 lines
Quoted 4 lines
Also rename the FBCQ disable bit to resemble the name we've given to a similar bit on earlier platforms.
Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Damien Lespiau <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch