* [PATCH] drm/i915: use the correct encoder type when comparing
@ 2012-08-10 13:05 Paulo Zanoni
2012-08-10 13:27 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Paulo Zanoni @ 2012-08-10 13:05 UTC (permalink / raw)
To: intel-gfx; +Cc: Paulo Zanoni
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
- intel_encoder->type is INTEL_OUTPUT_SOMETHING
- drm_encoder->encoder_type is DRM_MODE_ENCODER_SOMETHING
Here we're using intel_encoder, so compare the oranges against
oranges. While at it, rename the variable to "intel_encoder" so we
keep our naming standards used everywhere.
Luckily this was not a bug because both DRM_MODE_ENCODER_DAC and
INTEL_OUTPUT_ANALOG are defined as 1. This is the only case where the
drm definition matches the intel definition.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
This was not tested, just compiled :)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2e1f28f..ea19a72 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2837,13 +2837,13 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
- struct intel_encoder *encoder;
+ struct intel_encoder *intel_encoder;
/*
* If there's a non-PCH eDP on this crtc, it must be DP_A, and that
* must be driven by its own crtc; no sharing is possible.
*/
- for_each_encoder_on_crtc(dev, crtc, encoder) {
+ for_each_encoder_on_crtc(dev, crtc, intel_encoder) {
/* On Haswell, LPT PCH handles the VGA connection via FDI, and Haswell
* CPU handles all others */
@@ -2851,19 +2851,19 @@ static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
/* It is still unclear how this will work on PPT, so throw up a warning */
WARN_ON(!HAS_PCH_LPT(dev));
- if (encoder->type == DRM_MODE_ENCODER_DAC) {
+ if (intel_encoder->type == INTEL_OUTPUT_ANALOG) {
DRM_DEBUG_KMS("Haswell detected DAC encoder, assuming is PCH\n");
return true;
} else {
DRM_DEBUG_KMS("Haswell detected encoder %d, assuming is CPU\n",
- encoder->type);
+ intel_encoder->type);
return false;
}
}
- switch (encoder->type) {
+ switch (intel_encoder->type) {
case INTEL_OUTPUT_EDP:
- if (!intel_encoder_is_pch_edp(&encoder->base))
+ if (!intel_encoder_is_pch_edp(&intel_encoder->base))
return false;
continue;
}
--
1.7.11.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: use the correct encoder type when comparing
2012-08-10 13:05 [PATCH] drm/i915: use the correct encoder type when comparing Paulo Zanoni
@ 2012-08-10 13:27 ` Jani Nikula
2012-08-10 16:34 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2012-08-10 13:27 UTC (permalink / raw)
To: Paulo Zanoni, intel-gfx; +Cc: Paulo Zanoni
On Fri, 10 Aug 2012, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> - intel_encoder->type is INTEL_OUTPUT_SOMETHING
> - drm_encoder->encoder_type is DRM_MODE_ENCODER_SOMETHING
>
> Here we're using intel_encoder, so compare the oranges against
> oranges. While at it, rename the variable to "intel_encoder" so we
> keep our naming standards used everywhere.
intel_display.c still has plenty of 'struct intel_encoder *encoder'...
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Luckily this was not a bug because both DRM_MODE_ENCODER_DAC and
> INTEL_OUTPUT_ANALOG are defined as 1. This is the only case where the
> drm definition matches the intel definition.
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> This was not tested, just compiled :)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2e1f28f..ea19a72 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2837,13 +2837,13 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
> static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
> {
> struct drm_device *dev = crtc->dev;
> - struct intel_encoder *encoder;
> + struct intel_encoder *intel_encoder;
>
> /*
> * If there's a non-PCH eDP on this crtc, it must be DP_A, and that
> * must be driven by its own crtc; no sharing is possible.
> */
> - for_each_encoder_on_crtc(dev, crtc, encoder) {
> + for_each_encoder_on_crtc(dev, crtc, intel_encoder) {
>
> /* On Haswell, LPT PCH handles the VGA connection via FDI, and Haswell
> * CPU handles all others */
> @@ -2851,19 +2851,19 @@ static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
> /* It is still unclear how this will work on PPT, so throw up a warning */
> WARN_ON(!HAS_PCH_LPT(dev));
>
> - if (encoder->type == DRM_MODE_ENCODER_DAC) {
> + if (intel_encoder->type == INTEL_OUTPUT_ANALOG) {
> DRM_DEBUG_KMS("Haswell detected DAC encoder, assuming is PCH\n");
> return true;
> } else {
> DRM_DEBUG_KMS("Haswell detected encoder %d, assuming is CPU\n",
> - encoder->type);
> + intel_encoder->type);
> return false;
> }
> }
>
> - switch (encoder->type) {
> + switch (intel_encoder->type) {
> case INTEL_OUTPUT_EDP:
> - if (!intel_encoder_is_pch_edp(&encoder->base))
> + if (!intel_encoder_is_pch_edp(&intel_encoder->base))
> return false;
> continue;
> }
> --
> 1.7.11.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: use the correct encoder type when comparing
2012-08-10 13:27 ` Jani Nikula
@ 2012-08-10 16:34 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-08-10 16:34 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx, Paulo Zanoni
On Fri, Aug 10, 2012 at 04:27:23PM +0300, Jani Nikula wrote:
> On Fri, 10 Aug 2012, Paulo Zanoni <przanoni@gmail.com> wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > - intel_encoder->type is INTEL_OUTPUT_SOMETHING
> > - drm_encoder->encoder_type is DRM_MODE_ENCODER_SOMETHING
> >
> > Here we're using intel_encoder, so compare the oranges against
> > oranges. While at it, rename the variable to "intel_encoder" so we
> > keep our naming standards used everywhere.
>
> intel_display.c still has plenty of 'struct intel_encoder *encoder'...
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Queued for -next, thanks for the patch.
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-10 16:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-10 13:05 [PATCH] drm/i915: use the correct encoder type when comparing Paulo Zanoni
2012-08-10 13:27 ` Jani Nikula
2012-08-10 16:34 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox