drm/i915/audio: constify ELD pointers
Subsystems (2)
PATCH 1/1 drm/i915/audio: constify ELD pointers
The hooks aren't supposed to modify the ELD, so use const pointer. As a drive-by fix, use drm_eld_size() to log ELD size.
--- drivers/gpu/drm/i915/intel_audio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_audio.c +8 -8
@@ -213,7 +213,7 @@ static bool intel_eld_uptodate(struct drm_connector *connector, i915_reg_t reg_edid) {struct drm_i915_private *dev_priv =to_i915 (connector->dev); -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 tmp;int i;
@@ -228,7 +228,7 @@ static bool intel_eld_uptodate(struct drm_connector *connector,I915_WRITE (reg_elda, tmp);for (i =0 ; i <drm_eld_size (eld) /4 ; i++) -if (I915_READ (reg_edid) != *((u32 *)eld + i)) +if (I915_READ (reg_edid) != *((const u32 *)eld + i))return false;return true;
@@ -261,12 +261,12 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct drm_connector *connector = conn_state->connector; -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 eldv;u32 tmp;int len, i; -DRM_DEBUG_KMS ("Enable audio codec, %u bytes ELD\n" , eld[2 ]); +DRM_DEBUG_KMS ("Enable audio codec, %u bytes ELD\n" ,drm_eld_size (eld)); tmp =I915_READ (G4X_AUD_VID_DID );if (tmp ==INTEL_AUDIO_DEVBLC || tmp ==INTEL_AUDIO_DEVCL )
@@ -288,7 +288,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, len =min (drm_eld_size (eld) /4 , len);DRM_DEBUG_DRIVER ("ELD size %d\n" , len);for (i =0 ; i < len; i++) -I915_WRITE (G4X_HDMIW_HDMIEDID , *((u32 *)eld + i)); +I915_WRITE (G4X_HDMIW_HDMIEDID , *((const u32 *)eld + i)); tmp =I915_READ (G4X_AUD_CNTL_ST ); tmp |= eldv;
@@ -466,7 +466,7 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,/* Up to 84 bytes of hw ELD buffer */ len =min (drm_eld_size (eld),84 );for (i =0 ; i < len /4 ; i++) -I915_WRITE (HSW_AUD_EDID_DATA (pipe), *((u32 *)eld + i)); +I915_WRITE (HSW_AUD_EDID_DATA (pipe), *((const u32 *)eld + i));/* ELD valid */ tmp =I915_READ (HSW_AUD_PIN_ELD_CP_VLD );
@@ -534,7 +534,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,struct drm_connector *connector = conn_state->connector;enum pipe pipe = crtc->pipe;enum port port = encoder->port; -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 tmp, eldv;int len, i;i915_reg_t hdmiw_hdmiedid, aud_config, aud_cntl_st, aud_cntrl_st2;
@@ -585,7 +585,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,/* Up to 84 bytes of hw ELD buffer */ len =min (drm_eld_size (eld),84 );for (i =0 ; i < len /4 ; i++) -I915_WRITE (hdmiw_hdmiedid, *((u32 *)eld + i)); +I915_WRITE (hdmiw_hdmiedid, *((const u32 *)eld + i));/* ELD valid */ tmp =I915_READ (aud_cntrl_st2);
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm/i915/audio: constify ELD pointers
== Series Details ==
== Series Details ==
Series: drm/i915/audio: constify ELD pointers
URL : https://patchwork.freedesktop.org/series/45014/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Commit: drm/i915/audio: constify ELD pointers -O:drivers/gpu/drm/i915/intel_audio.c:288:15: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_audio.c:288:15: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_audio.c:467:15: warning: expression using sizeof(void) -O:drivers/gpu/drm/i915/intel_audio.c:586:15: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_audio.c:288:15: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_audio.c:288:15: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_audio.c:467:15: warning: expression using sizeof(void) +drivers/gpu/drm/i915/intel_audio.c:586:15: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 23 lines · Jani Nikula
The hooks aren't supposed to modify the ELD, so use const pointer. As a drive-by fix, use
drm_eld_size()to log ELD size.Suggested-by Ville Syrjala <[email protected]>Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/intel_audio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/i915/intel_audio.c +1
-1@@ -213,7 +213,7 @@ static bool intel_eld_uptodate(struct drm_connector *connector, i915_reg_t reg_edid) {struct drm_i915_private *dev_priv =to_i915 (connector->dev); -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 tmp;int i;
drivers/gpu/drm/i915/intel_audio.c static bool intel_eld_uptodate(struct drm_connector *connector, · line 231
Quoted 5 lines
drivers/gpu/drm/i915/intel_audio.c +1
-1@@ -228,7 +228,7 @@ static bool intel_eld_uptodate(struct drm_connector *connector,I915_WRITE (reg_elda, tmp);for (i =0 ; i <drm_eld_size (eld) /4 ; i++) -if (I915_READ (reg_edid) != *((u32 *)eld + i)) +if (I915_READ (reg_edid) != *((const u32 *)eld + i))
I was hoping we could make it const u32* and kill these ugly casts. But I suppose that would require more casts for the drm_eld_size() & co., or changing those to take a const void* instead.
Anyways, the const alone is an improvement so
Quoted 56 lines
drivers/gpu/drm/i915/intel_audio.c +6
-6return false;return true;@@ -261,12 +261,12 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct drm_connector *connector = conn_state->connector; -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 eldv;u32 tmp;int len, i; -DRM_DEBUG_KMS ("Enable audio codec, %u bytes ELD\n" , eld[2 ]); +DRM_DEBUG_KMS ("Enable audio codec, %u bytes ELD\n" ,drm_eld_size (eld)); tmp =I915_READ (G4X_AUD_VID_DID );if (tmp ==INTEL_AUDIO_DEVBLC || tmp ==INTEL_AUDIO_DEVCL )@@ -288,7 +288,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder, len =min (drm_eld_size (eld) /4 , len);DRM_DEBUG_DRIVER ("ELD size %d\n" , len);for (i =0 ; i < len; i++) -I915_WRITE (G4X_HDMIW_HDMIEDID , *((u32 *)eld + i)); +I915_WRITE (G4X_HDMIW_HDMIEDID , *((const u32 *)eld + i)); tmp =I915_READ (G4X_AUD_CNTL_ST ); tmp |= eldv;@@ -466,7 +466,7 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,/* Up to 84 bytes of hw ELD buffer */ len =min (drm_eld_size (eld),84 );for (i =0 ; i < len /4 ; i++) -I915_WRITE (HSW_AUD_EDID_DATA (pipe), *((u32 *)eld + i)); +I915_WRITE (HSW_AUD_EDID_DATA (pipe), *((const u32 *)eld + i));/* ELD valid */ tmp =I915_READ (HSW_AUD_PIN_ELD_CP_VLD );@@ -534,7 +534,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,struct drm_connector *connector = conn_state->connector;enum pipe pipe = crtc->pipe;enum port port = encoder->port; -u8 *eld = connector->eld; +const u8 *eld = connector->eld;u32 tmp, eldv;int len, i;i915_reg_t hdmiw_hdmiedid, aud_config, aud_cntl_st, aud_cntrl_st2;@@ -585,7 +585,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,/* Up to 84 bytes of hw ELD buffer */ len =min (drm_eld_size (eld),84 );for (i =0 ; i < len /4 ; i++) -I915_WRITE (hdmiw_hdmiedid, *((u32 *)eld + i)); +I915_WRITE (hdmiw_hdmiedid, *((const u32 *)eld + i));/* ELD valid */ tmp =I915_READ (aud_cntrl_st2);Signature · 1 line
2.11.0
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/audio: constify ELD pointers
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915/audio: constify ELD pointers
URL : https://patchwork.freedesktop.org/series/45014/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4341 -> Patchwork_9358 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/45014/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_9358 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_module_reload@basic-no-display:
fi-cnl-psr: NOTRUN -> DMESG-WARN (fdo#105395) +2
igt@gem_ctx_create@basic-files:
fi-skl-guc: PASS -> DMESG-WARN (fdo#106954)
igt@gem_exec_gttfill@basic:
fi-byt-n2820: PASS -> FAIL (fdo#106744)
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: PASS -> DMESG-FAIL (fdo#106103, fdo#102614)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-skl-6700k2: PASS -> INCOMPLETE (fdo#104108, k.org#199541, fdo#105524)
==== Possible fixes ====
igt@kms_flip@basic-flip-vs-dpms:
fi-glk-j4005: DMESG-WARN (fdo#106000, fdo#106097) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-cnl-psr: INCOMPLETE (fdo#105086) -> PASS
fi-glk-j4005: DMESG-WARN (fdo#106097) -> PASS +1 fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086
fdo#105395 https://bugs.freedesktop.org/show_bug.cgi?id=105395
fdo#105524 https://bugs.freedesktop.org/show_bug.cgi?id=105524
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
fdo#106744 https://bugs.freedesktop.org/show_bug.cgi?id=106744
fdo#106954 https://bugs.freedesktop.org/show_bug.cgi?id=106954
k.org#199541 https://bugzilla.kernel.org/show_bug.cgi?id=199541
== Participating hosts (43 -> 38) ==
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4341 -> Patchwork_9358
CI_DRM_4341: 1a2269d72a9a9f67fa83d799df63c98004faa2f1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4523: 778497e7965dc8662c770a89ebbd741778feb71e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9358: d99a99702ca9a9176e45466ebc08dae4352a09c1 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
d99a99702ca9 drm/i915/audio: constify ELD pointers
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9358/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/audio: constify ELD pointers
In reply to Jani Nikula== Series Details ==
== Series Details ==
Series: drm/i915/audio: constify ELD pointers
URL : https://patchwork.freedesktop.org/series/45014/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4341_full -> Patchwork_9358_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9358_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_9358_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9358_full:
=== IGT changes ===
==== Warnings ====
igt@drv_selftest@live_guc:
shard-kbl: SKIP -> PASS +1== Known issues ==
Here are the changes found in Patchwork_9358_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_hangcheck:
shard-apl: NOTRUN -> DMESG-FAIL (fdo#106560, fdo#106947)
shard-glk: PASS -> DMESG-FAIL (fdo#106560, fdo#106947)
igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
shard-glk: PASS -> FAIL (fdo#106509, fdo#105454)
igt@kms_flip@2x-plain-flip-ts-check:
shard-glk: PASS -> FAIL (fdo#100368)
igt@kms_flip_tiling@flip-to-y-tiled:
shard-glk: PASS -> FAIL (fdo#104724, fdo#103822)
igt@kms_setmode@basic:
shard-apl: PASS -> FAIL (fdo#99912)
==== Possible fixes ====
igt@drv_selftest@live_gtt:
shard-apl: INCOMPLETE (fdo#103927) -> PASS
igt@drv_suspend@shrink:
shard-snb: INCOMPLETE (fdo#105411) -> PASS +1
igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
shard-glk: DMESG-WARN (fdo#105763, fdo#106538) -> PASS
igt@kms_flip@2x-plain-flip-ts-check-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: FAIL (fdo#105189) -> PASS
igt@kms_flip@modeset-vs-vblank-race-interruptible:
shard-hsw: FAIL (fdo#103060) -> PASS
igt@kms_setmode@basic:
shard-kbl: FAIL (fdo#99912) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4341 -> Patchwork_9358
CI_DRM_4341: 1a2269d72a9a9f67fa83d799df63c98004faa2f1 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4523: 778497e7965dc8662c770a89ebbd741778feb71e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9358: d99a99702ca9a9176e45466ebc08dae4352a09c1 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9358/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx