Skip to content

Commit aa7d827

Browse files
committed
drm/i915/sdvo: Simplify output setup debugs
Get rid of this funny byte based dumping of invalid output flags and just dump it as a single hex numbers. Also do that early since all the rest is going to get skipped anyway of the thing is zero. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
1 parent a3cd4f4 commit aa7d827

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

drivers/gpu/drm/i915/display/intel_sdvo.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ to_intel_sdvo_connector(struct drm_connector *connector)
199199
container_of((conn_state), struct intel_sdvo_connector_state, base.base)
200200

201201
static bool
202-
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags);
202+
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo);
203203
static bool
204204
intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
205205
struct intel_sdvo_connector *intel_sdvo_connector,
@@ -2946,11 +2946,18 @@ static u16 intel_sdvo_filter_output_flags(u16 flags)
29462946
}
29472947

29482948
static bool
2949-
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
2949+
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo)
29502950
{
29512951
struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev);
2952+
u16 flags;
29522953

2953-
flags = intel_sdvo_filter_output_flags(flags);
2954+
flags = intel_sdvo_filter_output_flags(intel_sdvo->caps.output_flags);
2955+
2956+
if (flags == 0) {
2957+
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%04x)\n",
2958+
SDVO_NAME(intel_sdvo), intel_sdvo->caps.output_flags);
2959+
return false;
2960+
}
29542961

29552962
intel_sdvo->controlled_output = flags;
29562963

@@ -2993,15 +3000,6 @@ intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
29933000
if (!intel_sdvo_lvds_init(intel_sdvo, 1))
29943001
return false;
29953002

2996-
if (flags == 0) {
2997-
unsigned char bytes[2];
2998-
2999-
memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
3000-
DRM_DEBUG_KMS("%s: Unknown SDVO output type (0x%02x%02x)\n",
3001-
SDVO_NAME(intel_sdvo),
3002-
bytes[0], bytes[1]);
3003-
return false;
3004-
}
30053003
intel_sdvo->base.pipe_mask = ~0;
30063004

30073005
return true;
@@ -3377,8 +3375,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
33773375
intel_sdvo->colorimetry_cap =
33783376
intel_sdvo_get_colorimetry_cap(intel_sdvo);
33793377

3380-
if (intel_sdvo_output_setup(intel_sdvo,
3381-
intel_sdvo->caps.output_flags) != true) {
3378+
if (!intel_sdvo_output_setup(intel_sdvo)) {
33823379
drm_dbg_kms(&dev_priv->drm,
33833380
"SDVO output failed to setup on %s\n",
33843381
SDVO_NAME(intel_sdvo));

0 commit comments

Comments
 (0)