Skip to contentSkip to conversation

drm/i915: Inline SUPPORTS_DIGITAL_OUTPUTS

PATCH Applied Daniel Vetter 3 participants 3 messages Jul 7, 2015

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

PATCH 1/1 drm/i915: Inline SUPPORTS_DIGITAL_OUTPUTS

After the register save/restore code is gone there's just one user left and it just obfuscates that one. Remove it.

---
 drivers/gpu/drm/i915/i915_drv.h      | 1 -
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -1
index 0d9a60b9e6c5..ee956a165d46 100644
@@ -2511,7 +2511,6 @@ struct drm_i915_cmd_table {
  */
 #define HAS_128_BYTE_Y_TILING(dev) (!IS_GEN2(dev) && !(IS_I915G(dev) || \
 						      IS_I915GM(dev)))
-#define SUPPORTS_DIGITAL_OUTPUTS(dev)	(!IS_GEN2(dev) && !IS_PINEVIEW(dev))
 #define SUPPORTS_TV(dev)		(INTEL_INFO(dev)->supports_tv)
 #define I915_HAS_HOTPLUG(dev)		 (INTEL_INFO(dev)->has_hotplug)
 
drivers/gpu/drm/i915/intel_display.c +1 -1
index 87be3f307e40..0663e1d97979 100644
@@ -14316,7 +14316,7 @@ static void intel_setup_outputs(struct drm_device *dev)
 		}
 
 		intel_dsi_init(dev);
-	} else if (SUPPORTS_DIGITAL_OUTPUTS(dev)) {
+	} else if (!IS_GEN2(dev) && !IS_PINEVIEW(dev)) {
 		bool found = false;
 
 		if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Daniel Vetter

After the register save/restore code is gone there's just one user left and it just obfuscates that one. Remove it.

---
 drivers/gpu/drm/i915/i915_drv.h      | 1 -
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -1
index 0d9a60b9e6c5..ee956a165d46 100644
@@ -2511,7 +2511,6 @@ struct drm_i915_cmd_table {
  */
 #define HAS_128_BYTE_Y_TILING(dev) (!IS_GEN2(dev) && !(IS_I915G(dev) || \
 						      IS_I915GM(dev)))
-#define SUPPORTS_DIGITAL_OUTPUTS(dev)	(!IS_GEN2(dev) && !IS_PINEVIEW(dev))
 #define SUPPORTS_TV(dev)		(INTEL_INFO(dev)->supports_tv)
 #define I915_HAS_HOTPLUG(dev)		 (INTEL_INFO(dev)->has_hotplug)
 
drivers/gpu/drm/i915/intel_display.c +0 -0
index 87be3f307e40..0663e1d97979 100644

drivers/gpu/drm/i915/intel_display.c static void intel_setup_outputs(struct drm_device *dev) · line 14322

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -14316,7 +14316,7 @@ static void intel_setup_outputs(struct drm_device *dev)
 		}
 
 		intel_dsi_init(dev);
-	} else if (SUPPORTS_DIGITAL_OUTPUTS(dev)) {
+	} else if (!IS_GEN2(dev) && !IS_PINEVIEW(dev)) {
 		bool found = false;
 
 		if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {

That is one wierd if-tree. At least half the problem is that we cannot see the if-elif-else chain because each branch is over a page high! And the other half is that there is no apparent logic between say HAS_DDI or HAS_PCH_SPLIT so knowing which should be applying to your device of interest is difficult.

Anyway,

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 36 lines · Chris Wilson
Quoted 35 lines · Daniel Vetter

After the register save/restore code is gone there's just one user left and it just obfuscates that one. Remove it.

---
 drivers/gpu/drm/i915/i915_drv.h      | 1 -
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -1
index 0d9a60b9e6c5..ee956a165d46 100644
@@ -2511,7 +2511,6 @@ struct drm_i915_cmd_table {
  */
 #define HAS_128_BYTE_Y_TILING(dev) (!IS_GEN2(dev) && !(IS_I915G(dev) || \
 						      IS_I915GM(dev)))
-#define SUPPORTS_DIGITAL_OUTPUTS(dev)	(!IS_GEN2(dev) && !IS_PINEVIEW(dev))
 #define SUPPORTS_TV(dev)		(INTEL_INFO(dev)->supports_tv)
 #define I915_HAS_HOTPLUG(dev)		 (INTEL_INFO(dev)->has_hotplug)
 
drivers/gpu/drm/i915/intel_display.c +1 -1
index 87be3f307e40..0663e1d97979 100644
@@ -14316,7 +14316,7 @@ static void intel_setup_outputs(struct drm_device *dev)
 		}
 
 		intel_dsi_init(dev);
-	} else if (SUPPORTS_DIGITAL_OUTPUTS(dev)) {
+	} else if (!IS_GEN2(dev) && !IS_PINEVIEW(dev)) {
 		bool found = false;
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c static void intel_setup_outputs(struct drm_device *dev) · line 14322

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
 		if (I915_READ(GEN3_SDVOB) & SDVO_DETECTED) {

That is one wierd if-tree. At least half the problem is that we cannot see the if-elif-else chain because each branch is over a page high! And the other half is that there is no apparent logic between say HAS_DDI or HAS_PCH_SPLIT so knowing which should be applying to your device of interest is difficult.

It is. I tried pushing some of the decisions into lower-level functions (like the detection for dig ports) to clean it up a bit, but didn't improve really. No other idea thus far what to do with it.

Quoted 2 lines

Anyway,

Queued for -next, thanks for the review.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx