Message ID | 1471961888-10771-1-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Aug 23, 2016 at 04:18:07PM +0200, Maarten Lankhorst wrote: > This makes the code in intel_sanitize_encoder slightly more readable. > This was meant to be addressed in fd6bbda9c7a4, but I missed that > review comment. > > Fixes: fd6bbda9c7a4 ("drm/i915: Pass crtc_state and connector_state to encoder functions") > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Yeah, prettiness restored! Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > --- > drivers/gpu/drm/i915/intel_display.c | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 2dd2c0e9ae32..2ae080f947e8 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -16423,6 +16423,17 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc) > return false; > } > > +static struct intel_connector *intel_encoder_find_connector(struct intel_encoder *encoder) > +{ > + struct drm_device *dev = encoder->base.dev; > + struct intel_connector *connector; > + > + for_each_connector_on_encoder(dev, &encoder->base, connector) > + return connector; > + > + return NULL; > +} > + > static bool has_pch_trancoder(struct drm_i915_private *dev_priv, > enum transcoder pch_transcoder) > { > @@ -16526,7 +16537,6 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) > { > struct intel_connector *connector; > struct drm_device *dev = encoder->base.dev; > - bool found_connector = false; > > /* We need to check both for a crtc link (meaning that the > * encoder is active and trying to read from a pipe) and the > @@ -16534,12 +16544,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) > bool has_active_crtc = encoder->base.crtc && > to_intel_crtc(encoder->base.crtc)->active; > > - for_each_connector_on_encoder(dev, &encoder->base, connector) { > - found_connector = true; > - break; > - } > - > - if (found_connector && !has_active_crtc) { > + connector = intel_encoder_find_connector(encoder); > + if (connector && !has_active_crtc) { > DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n", > encoder->base.base.id, > encoder->base.name); > -- > 2.7.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Maarten,
[auto build test WARNING on drm-intel/for-linux-next]
[cannot apply to v4.8-rc3 next-20160823]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Maarten-Lankhorst/drm-i915-Create-a-intel_encoder_find_connector-helper-function/20160823-222308
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x016-201634 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_display.c: In function 'intel_sanitize_encoder':
>> drivers/gpu/drm/i915/intel_display.c:16539:21: warning: unused variable 'dev' [-Wunused-variable]
struct drm_device *dev = encoder->base.dev;
^~~
vim +/dev +16539 drivers/gpu/drm/i915/intel_display.c
a168f5b3f1 Ville Syrjälä 2016-08-05 16523 * We track the PCH trancoder underrun reporting state
a168f5b3f1 Ville Syrjälä 2016-08-05 16524 * within the crtc. With crtc for pipe A housing the underrun
a168f5b3f1 Ville Syrjälä 2016-08-05 16525 * reporting state for PCH transcoder A, crtc for pipe B housing
a168f5b3f1 Ville Syrjälä 2016-08-05 16526 * it for PCH transcoder B, etc. LPT-H has only PCH transcoder A,
a168f5b3f1 Ville Syrjälä 2016-08-05 16527 * and marking underrun reporting as disabled for the non-existing
a168f5b3f1 Ville Syrjälä 2016-08-05 16528 * PCH transcoders B and C would prevent enabling the south
a168f5b3f1 Ville Syrjälä 2016-08-05 16529 * error interrupt (see cpt_can_enable_serr_int()).
a168f5b3f1 Ville Syrjälä 2016-08-05 16530 */
a168f5b3f1 Ville Syrjälä 2016-08-05 16531 if (has_pch_trancoder(dev_priv, (enum transcoder)crtc->pipe))
4cc3148930 Daniel Vetter 2014-03-24 16532 crtc->pch_fifo_underrun_disabled = true;
4cc3148930 Daniel Vetter 2014-03-24 16533 }
2492935248 Daniel Vetter 2012-07-02 16534 }
2492935248 Daniel Vetter 2012-07-02 16535
2492935248 Daniel Vetter 2012-07-02 16536 static void intel_sanitize_encoder(struct intel_encoder *encoder)
2492935248 Daniel Vetter 2012-07-02 16537 {
2492935248 Daniel Vetter 2012-07-02 16538 struct intel_connector *connector;
2492935248 Daniel Vetter 2012-07-02 @16539 struct drm_device *dev = encoder->base.dev;
2492935248 Daniel Vetter 2012-07-02 16540
2492935248 Daniel Vetter 2012-07-02 16541 /* We need to check both for a crtc link (meaning that the
2492935248 Daniel Vetter 2012-07-02 16542 * encoder is active and trying to read from a pipe) and the
2492935248 Daniel Vetter 2012-07-02 16543 * pipe itself being active. */
2492935248 Daniel Vetter 2012-07-02 16544 bool has_active_crtc = encoder->base.crtc &&
2492935248 Daniel Vetter 2012-07-02 16545 to_intel_crtc(encoder->base.crtc)->active;
2492935248 Daniel Vetter 2012-07-02 16546
d1b4131c19 Maarten Lankhorst 2016-08-23 16547 connector = intel_encoder_find_connector(encoder);
:::::: The code at line 16539 was first introduced by commit
:::::: 24929352481f085c5f85d4d4cbc919ddf106d381 drm/i915: read out the modeset hw state at load and resume time
:::::: TO: Daniel Vetter <daniel.vetter@ffwll.ch>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Maarten,
[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to v4.8-rc3 next-20160823]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Maarten-Lankhorst/drm-i915-Create-a-intel_encoder_find_connector-helper-function/20160823-222308
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-x009-201634 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/intel_display.c: In function 'intel_sanitize_encoder':
>> drivers/gpu/drm/i915/intel_display.c:16539:21: error: unused variable 'dev' [-Werror=unused-variable]
struct drm_device *dev = encoder->base.dev;
^~~
cc1: all warnings being treated as errors
vim +/dev +16539 drivers/gpu/drm/i915/intel_display.c
4cc31489 Daniel Vetter 2014-03-24 16533 }
24929352 Daniel Vetter 2012-07-02 16534 }
24929352 Daniel Vetter 2012-07-02 16535
24929352 Daniel Vetter 2012-07-02 16536 static void intel_sanitize_encoder(struct intel_encoder *encoder)
24929352 Daniel Vetter 2012-07-02 16537 {
24929352 Daniel Vetter 2012-07-02 16538 struct intel_connector *connector;
24929352 Daniel Vetter 2012-07-02 @16539 struct drm_device *dev = encoder->base.dev;
24929352 Daniel Vetter 2012-07-02 16540
24929352 Daniel Vetter 2012-07-02 16541 /* We need to check both for a crtc link (meaning that the
24929352 Daniel Vetter 2012-07-02 16542 * encoder is active and trying to read from a pipe) and the
:::::: The code at line 16539 was first introduced by commit
:::::: 24929352481f085c5f85d4d4cbc919ddf106d381 drm/i915: read out the modeset hw state at load and resume time
:::::: TO: Daniel Vetter <daniel.vetter@ffwll.ch>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2dd2c0e9ae32..2ae080f947e8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -16423,6 +16423,17 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc) return false; } +static struct intel_connector *intel_encoder_find_connector(struct intel_encoder *encoder) +{ + struct drm_device *dev = encoder->base.dev; + struct intel_connector *connector; + + for_each_connector_on_encoder(dev, &encoder->base, connector) + return connector; + + return NULL; +} + static bool has_pch_trancoder(struct drm_i915_private *dev_priv, enum transcoder pch_transcoder) { @@ -16526,7 +16537,6 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) { struct intel_connector *connector; struct drm_device *dev = encoder->base.dev; - bool found_connector = false; /* We need to check both for a crtc link (meaning that the * encoder is active and trying to read from a pipe) and the @@ -16534,12 +16544,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) bool has_active_crtc = encoder->base.crtc && to_intel_crtc(encoder->base.crtc)->active; - for_each_connector_on_encoder(dev, &encoder->base, connector) { - found_connector = true; - break; - } - - if (found_connector && !has_active_crtc) { + connector = intel_encoder_find_connector(encoder); + if (connector && !has_active_crtc) { DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n", encoder->base.base.id, encoder->base.name);
This makes the code in intel_sanitize_encoder slightly more readable. This was meant to be addressed in fd6bbda9c7a4, but I missed that review comment. Fixes: fd6bbda9c7a4 ("drm/i915: Pass crtc_state and connector_state to encoder functions") Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> --- drivers/gpu/drm/i915/intel_display.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)