Skip to contentSkip to conversation

Future preparation patches

PATCH In review [email protected] 2 participants 17 messages Jul 21, 2014 – Jul 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Future preparation patches

From: Sonika Jindal <[email protected]>

This series prepares future platform enabling by changing HAS_PCH_SPLIT to more appropriate check since the code accessed may not have anything to do with having PCH or not.

v2: Adding new HAS_GMCH_DISPLAY macro suggested by Daniel. Also taking care of Ironlake(gen 5), by making gen < 5 check suggested by Damien. Effectively, !HAS_PCH_SPLIT is equivalent to HAS_GMCH_DISPLAY
and HAS_PCH_SPLIT is equivalent to gen >= 5 && !(VALLEYVIEW).

Sonika Jindal (8):
drm/i915: Adding HAS_GMCH_DISPLAY macro
drm/i915: Allowing changing of wm latencies for valid platforms drm/i915: Returning the right VGA control reg for platforms drm/i915: Setting legacy palette correctly for different platforms drm/i915: Returning from increase/decrease of pllclock when invalid drm/i915: Writing proper check for reading of pipe status reg drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms
in
drm/i915: Avoid incorrect returning for some platforms

 drivers/gpu/drm/i915/i915_debugfs.c  |    6 +++---
 drivers/gpu/drm/i915/i915_drv.h      |    8 +++++---
 drivers/gpu/drm/i915/intel_display.c |    8 ++++----
 drivers/gpu/drm/i915/intel_hdmi.c    |    4 ++--
 4 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/8 drm/i915: Adding HAS_GMCH_DISPLAY macro

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 991b663..4e28192 100644
@@ -2092,6 +2092,8 @@ struct drm_i915_cmd_table {
 #define HAS_PCH_NOP(dev) (INTEL_PCH_TYPE(dev) == PCH_NOP)
 #define HAS_PCH_SPLIT(dev) (INTEL_PCH_TYPE(dev) != PCH_NONE)
 
+#define HAS_GMCH_DISPLAY(dev) (INTEL_INFO(dev)->gen < 5 || IS_VALLEYVIEW(dev))
+
 /* DPF == dynamic parity feature */
 #define HAS_L3_DPF(dev) (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
 #define NUM_L3_SLICES(dev) (IS_HSW_GT3(dev) ? 2 : HAS_L3_DPF(dev))
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 2/8 drm/i915: Allowing changing of wm latencies for valid platforms

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/i915_debugfs.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -3
index fc39610..517c266 100644
@@ -3267,7 +3267,7 @@ static int pri_wm_latency_open(struct inode *inode, struct file *file)
 {
 	struct drm_device *dev = inode->i_private;
 
-	if (!HAS_PCH_SPLIT(dev))
+	if (HAS_GMCH_DISPLAY(dev))
 		return -ENODEV;
 
 	return single_open(file, pri_wm_latency_show, dev);
@@ -3277,7 +3277,7 @@ static int spr_wm_latency_open(struct inode *inode, struct file *file)
 {
 	struct drm_device *dev = inode->i_private;
 
-	if (!HAS_PCH_SPLIT(dev))
+	if (HAS_GMCH_DISPLAY(dev))
 		return -ENODEV;
 
 	return single_open(file, spr_wm_latency_show, dev);
@@ -3287,7 +3287,7 @@ static int cur_wm_latency_open(struct inode *inode, struct file *file)
 {
 	struct drm_device *dev = inode->i_private;
 
-	if (!HAS_PCH_SPLIT(dev))
+	if (HAS_GMCH_DISPLAY(dev))
 		return -ENODEV;
 
 	return single_open(file, cur_wm_latency_show, dev);
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH v2 3/8 drm/i915: Returning the right VGA control reg for platforms

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/i915_drv.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -3
index 4e28192..b932548 100644
@@ -2802,10 +2802,10 @@ int vlv_freq_opcode(struct drm_i915_private *dev_priv, int val);
 
 static inline uint32_t i915_vgacntrl_reg(struct drm_device *dev)
 {
-	if (HAS_PCH_SPLIT(dev))
-		return CPU_VGACNTRL;
-	else if (IS_VALLEYVIEW(dev))
+	if (IS_VALLEYVIEW(dev))
 		return VLV_VGACNTRL;
+	else if (INTEL_INFO(dev)->gen >= 5)
+		return CPU_VGACNTRL;
 	else
 		return VGACNTRL;
 }
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH v2 4/8 drm/i915: Setting legacy palette correctly for different platforms

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index c89b4ac..442d8ba 100644
@@ -3847,7 +3847,7 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
 	}
 
 	/* use legacy palette for Ironlake */
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))
 		palreg = LGC_PALETTE(pipe);
 
 	/* Workaround : Do not read or write the pipe palette/gamma data while
Signature · 1 line
1.7.10.4
#5 lore raw

Re: [PATCH 4/8] drm/i915: Setting legacy palette correctly for different platforms

Quoted 12 lines · On Mon, Jul 21, 2014 at 03:23:41PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index c89b4ac..442d8ba 100644

drivers/gpu/drm/i915/intel_display.c static void intel_crtc_load_lut(struct drm_crtc *crtc) · line 3850

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -3847,7 +3847,7 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
 	}
 
 	/* use legacy palette for Ironlake */
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))

Imo we should check for !HAS_GMCH_DISPLAY here.
-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 		palreg = LGC_PALETTE(pipe);
 
 	/* Workaround : Do not read or write the pipe palette/gamma data while
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#6 lore raw

PATCH v2 1/1 drm/i915: Setting legacy palette correctly for different platforms

From: Sonika Jindal <[email protected]>

v2: Adding !HAS_GMCH_DISPLAY(dev)

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index c89b4ac..3e73798 100644
@@ -3847,7 +3847,7 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
 	}
 
 	/* use legacy palette for Ironlake */
-	if (HAS_PCH_SPLIT(dev))
+	if (!HAS_GMCH_DISPLAY(dev))
 		palreg = LGC_PALETTE(pipe);
 
 	/* Workaround : Do not read or write the pipe palette/gamma data while
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH v2 5/8 drm/i915: Returning from increase/decrease of pllclock when invalid

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
index 442d8ba..f6cf9bb 100644
@@ -8783,7 +8783,7 @@ static void intel_increase_pllclock(struct drm_device *dev,
 	int dpll_reg = DPLL(pipe);
 	int dpll;
 
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
@@ -8811,7 +8811,7 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
Signature · 1 line
1.7.10.4
#8 lore raw

Re: [PATCH 5/8] drm/i915: Returning from increase/decrease of pllclock when invalid

Quoted 12 lines · On Mon, Jul 21, 2014 at 03:23:42PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 442d8ba..f6cf9bb 100644

drivers/gpu/drm/i915/intel_display.c static void intel_increase_pllclock(struct drm_device *dev, · line 8786

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -8783,7 +8783,7 @@ static void intel_increase_pllclock(struct drm_device *dev,
 	int dpll_reg = DPLL(pipe);
 	int dpll;
 
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))

Same as with the previous patch.
-Daniel

Quoted 19 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
@@ -8811,7 +8811,7 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
-	if (HAS_PCH_SPLIT(dev))
+	if (INTEL_INFO(dev)->gen >= 5 && !IS_VALLEYVIEW(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#9 lore raw

PATCH v2 1/1 drm/i915: Returning from increase/decrease of pllclock when invalid

From: Sonika Jindal <[email protected]>

v2: Adding !HAS_GMCH_DISPLAY(dev)

---
 drivers/gpu/drm/i915/intel_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +2 -2
index 3e73798..bd14600 100644
@@ -8783,7 +8783,7 @@ static void intel_increase_pllclock(struct drm_device *dev,
 	int dpll_reg = DPLL(pipe);
 	int dpll;
 
-	if (HAS_PCH_SPLIT(dev))
+	if (!HAS_GMCH_DISPLAY(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
@@ -8811,7 +8811,7 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
-	if (HAS_PCH_SPLIT(dev))
+	if (!HAS_GMCH_DISPLAY(dev))
 		return;
 
 	if (!dev_priv->lvds_downclock_avail)
Signature · 1 line
1.7.10.4
#10 lore raw

PATCH v2 6/8 drm/i915: Writing proper check for reading of pipe status reg

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index f6cf9bb..f74d1c2 100644
@@ -13244,7 +13244,7 @@ intel_display_capture_error_state(struct drm_device *dev)
 
 		error->pipe[i].source = I915_READ(PIPESRC(i));
 
-		if (!HAS_PCH_SPLIT(dev))
+		if (HAS_GMCH_DISPLAY(dev))
 			error->pipe[i].stat = I915_READ(PIPESTAT(i));
 	}
 
Signature · 1 line
1.7.10.4
#11 lore raw

PATCH v2 7/8 drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms in

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
index 5f8f4ca..458dd4f 100644
@@ -1562,7 +1562,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	if (IS_VALLEYVIEW(dev)) {
 		intel_hdmi->write_infoframe = vlv_write_infoframe;
 		intel_hdmi->set_infoframes = vlv_set_infoframes;
-	} else if (!HAS_PCH_SPLIT(dev)) {
+	} else if (INTEL_INFO(dev)->gen < 5) {
 		intel_hdmi->write_infoframe = g4x_write_infoframe;
 		intel_hdmi->set_infoframes = g4x_set_infoframes;
 	} else if (HAS_DDI(dev)) {
Signature · 1 line
1.7.10.4
#12 lore raw

Re: [PATCH 7/8] drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms in

Quoted 12 lines · On Mon, Jul 21, 2014 at 03:23:44PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +0 -0
index 5f8f4ca..458dd4f 100644

drivers/gpu/drm/i915/intel_hdmi.c void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, · line 1565

Quoted 5 lines
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
@@ -1562,7 +1562,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	if (IS_VALLEYVIEW(dev)) {
 		intel_hdmi->write_infoframe = vlv_write_infoframe;
 		intel_hdmi->set_infoframes = vlv_set_infoframes;
-	} else if (!HAS_PCH_SPLIT(dev)) {
+	} else if (INTEL_INFO(dev)->gen < 5) {

Maybe make this explicit and check for IS_G4X(dev) instead? It's the only platform where this case applies, and also nicely highlights how the g4x_ prefix of the functions matches.
-Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +0 -0
 		intel_hdmi->write_infoframe = g4x_write_infoframe;
 		intel_hdmi->set_infoframes = g4x_set_infoframes;
 	} else if (HAS_DDI(dev)) {
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#13 lore raw

PATCH v2 1/1 drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms in

From: Sonika Jindal <[email protected]>

v2: Adding IS_G4X instead of gen < 5 as suggested by Daniel

---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
index 5f8f4ca..2d1a3cb 100644
@@ -1562,7 +1562,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	if (IS_VALLEYVIEW(dev)) {
 		intel_hdmi->write_infoframe = vlv_write_infoframe;
 		intel_hdmi->set_infoframes = vlv_set_infoframes;
-	} else if (!HAS_PCH_SPLIT(dev)) {
+	} else if (IS_G4X(dev)) {
 		intel_hdmi->write_infoframe = g4x_write_infoframe;
 		intel_hdmi->set_infoframes = g4x_set_infoframes;
 	} else if (HAS_DDI(dev)) {
Signature · 1 line
1.7.10.4
#14 lore raw

Re: [PATCH v2] drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms in

Quoted 5 lines · On Tue, Jul 22, 2014 at 11:13:46AM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

v2: Adding IS_G4X instead of gen < 5 as suggested by Daniel

Merged the remaining patches, thanks.
-Daniel

Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
index 5f8f4ca..2d1a3cb 100644
@@ -1562,7 +1562,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	if (IS_VALLEYVIEW(dev)) {
 		intel_hdmi->write_infoframe = vlv_write_infoframe;
 		intel_hdmi->set_infoframes = vlv_set_infoframes;
-	} else if (!HAS_PCH_SPLIT(dev)) {
+	} else if (IS_G4X(dev)) {
 		intel_hdmi->write_infoframe = g4x_write_infoframe;
 		intel_hdmi->set_infoframes = g4x_set_infoframes;
 	} else if (HAS_DDI(dev)) {
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#15 lore raw

PATCH v2 8/8 drm/i915: Avoid incorrect returning for some platforms

In reply to [email protected]

From: Sonika Jindal <[email protected]>

---
 drivers/gpu/drm/i915/intel_hdmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +1 -1
index 458dd4f..ecdb2d5 100644
@@ -882,7 +882,7 @@ static bool hdmi_12bpc_possible(struct intel_crtc *crtc)
 	struct intel_encoder *encoder;
 	int count = 0, count_hdmi = 0;
 
-	if (!HAS_PCH_SPLIT(dev))
+	if (HAS_GMCH_DISPLAY(dev))
 		return false;
 
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
Signature · 1 line
1.7.10.4
#16 lore raw
In reply to [email protected]
Quoted 11 lines · On Mon, Jul 21, 2014 at 03:23:37PM +0530, [email protected] wrote:

From: Sonika Jindal <[email protected]>

This series prepares future platform enabling by changing HAS_PCH_SPLIT to more appropriate check since the code accessed may not have anything to do with having PCH or not.

v2: Adding new HAS_GMCH_DISPLAY macro suggested by Daniel. Also taking care of Ironlake(gen 5), by making gen < 5 check suggested by Damien. Effectively, !HAS_PCH_SPLIT is equivalent to HAS_GMCH_DISPLAY
and HAS_PCH_SPLIT is equivalent to gen >= 5 && !(VALLEYVIEW).

Quoted 10 lines

Sonika Jindal (8):
drm/i915: Adding HAS_GMCH_DISPLAY macro
drm/i915: Allowing changing of wm latencies for valid platforms drm/i915: Returning the right VGA control reg for platforms drm/i915: Setting legacy palette correctly for different platforms drm/i915: Returning from increase/decrease of pllclock when invalid drm/i915: Writing proper check for reading of pipe status reg drm/i915: Replace HAS_PCH_SPLIT which incorrectly lets some platforms
in
drm/i915: Avoid incorrect returning for some platforms

I commented on a few patches, all others merged to dinq.

Thanks, Daniel

Quoted 14 lines
 drivers/gpu/drm/i915/i915_debugfs.c  |    6 +++---
 drivers/gpu/drm/i915/i915_drv.h      |    8 +++++---
 drivers/gpu/drm/i915/intel_display.c |    8 ++++----
 drivers/gpu/drm/i915/intel_hdmi.c    |    4 ++--
 4 files changed, 14 insertions(+), 12 deletions(-)
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch