diff mbox series

drm/i915/query: fix subslice length

Message ID 20181109004013.34394-1-daniele.ceraolospurio@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/query: fix subslice length | expand

Commit Message

Daniele Ceraolo Spurio Nov. 9, 2018, 12:40 a.m. UTC
We dump the info as an array of u8, so we want to know the length
in number of bytes. Current code is still safe because the
variable we use BITS_PER_TYPE on is a u8.

Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/i915_query.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Tvrtko Ursulin Nov. 9, 2018, 6:42 a.m. UTC | #1
On 09/11/2018 00:40, Daniele Ceraolo Spurio wrote:
> We dump the info as an array of u8, so we want to know the length
> in number of bytes. Current code is still safe because the
> variable we use BITS_PER_TYPE on is a u8.
> 
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_query.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> index 5821002cad42..6fc4b8eeab42 100644
> --- a/drivers/gpu/drm/i915/i915_query.c
> +++ b/drivers/gpu/drm/i915/i915_query.c
> @@ -27,8 +27,7 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
>   
>   	slice_length = sizeof(sseu->slice_mask);
>   	subslice_length = sseu->max_slices *
> -		DIV_ROUND_UP(sseu->max_subslices,
> -			     BITS_PER_TYPE(sseu->subslice_mask[0]));
> +		DIV_ROUND_UP(sseu->max_subslices, BITS_PER_BYTE);
>   	eu_length = sseu->max_slices * sseu->max_subslices *
>   		DIV_ROUND_UP(sseu->max_eus_per_subslice, BITS_PER_BYTE);
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Lionel Landwerlin Nov. 9, 2018, 11:18 a.m. UTC | #2
On 09/11/2018 00:40, Daniele Ceraolo Spurio wrote:
> We dump the info as an array of u8, so we want to know the length
> in number of bytes. Current code is still safe because the
> variable we use BITS_PER_TYPE on is a u8.
>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_query.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
> index 5821002cad42..6fc4b8eeab42 100644
> --- a/drivers/gpu/drm/i915/i915_query.c
> +++ b/drivers/gpu/drm/i915/i915_query.c
> @@ -27,8 +27,7 @@ static int query_topology_info(struct drm_i915_private *dev_priv,
>   
>   	slice_length = sizeof(sseu->slice_mask);
>   	subslice_length = sseu->max_slices *
> -		DIV_ROUND_UP(sseu->max_subslices,
> -			     BITS_PER_TYPE(sseu->subslice_mask[0]));
> +		DIV_ROUND_UP(sseu->max_subslices, BITS_PER_BYTE);
>   	eu_length = sseu->max_slices * sseu->max_subslices *
>   		DIV_ROUND_UP(sseu->max_eus_per_subslice, BITS_PER_BYTE);
>
Daniele Ceraolo Spurio Nov. 9, 2018, 9:35 p.m. UTC | #3
On 09/11/2018 03:15, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/query: fix subslice length
> URL   : https://patchwork.freedesktop.org/series/52270/
> State : success
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_5108_full -> Patchwork_10784_full =
> 
> == Summary - WARNING ==
> 
>    Minor unknown changes coming with Patchwork_10784_full need to be verified
>    manually.
>    
>    If you think the reported changes have nothing to do with the changes
>    introduced in Patchwork_10784_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_10784_full:
> 
>    === IGT changes ===
> 
>      ==== Warnings ====
> 
>      {igt@kms_lease@lease_invalid_connector}:
>        shard-snb:          SKIP -> PASS +1
> 
>      igt@perf_pmu@rc6:
>        shard-kbl:          SKIP -> PASS
> 

These are unrelated, but still good to see them switching to pass :)

Thanks for the reviews, patch pushed.

Daniele

>      
> == Known issues ==
> 
>    Here are the changes found in Patchwork_10784_full that come from known issues:
> 
>    === IGT changes ===
> 
>      ==== Issues hit ====
> 
>      igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
>        shard-apl:          PASS -> DMESG-WARN (fdo#107956)
> 
>      igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
>        shard-glk:          PASS -> FAIL (fdo#108145)
> 
>      igt@kms_chv_cursor_fail@pipe-c-64x64-right-edge:
>        shard-kbl:          PASS -> DMESG-WARN (fdo#105345)
> 
>      igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
>        shard-glk:          NOTRUN -> FAIL (fdo#106509, fdo#105454)
> 
>      igt@kms_draw_crc@draw-method-xrgb2101010-mmap-gtt-xtiled:
>        shard-skl:          PASS -> FAIL (fdo#103184)
> 
>      igt@kms_fbcon_fbt@psr-suspend:
>        shard-skl:          NOTRUN -> FAIL (fdo#107882)
> 
>      igt@kms_flip@plain-flip-ts-check:
>        shard-skl:          PASS -> FAIL (fdo#100368)
> 
>      igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
>        shard-skl:          NOTRUN -> FAIL (fdo#103167) +3
> 
>      igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
>        shard-glk:          PASS -> FAIL (fdo#103167)
> 
>      igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
>        shard-apl:          PASS -> FAIL (fdo#103167)
> 
>      igt@kms_frontbuffer_tracking@fbc-rgb565-draw-render:
>        shard-skl:          NOTRUN -> FAIL (fdo#105682)
> 
>      igt@kms_plane@pixel-format-pipe-c-planes:
>        shard-skl:          NOTRUN -> DMESG-WARN (fdo#106885)
> 
>      igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
>        shard-skl:          PASS -> FAIL (fdo#107815)
> 
>      igt@kms_rotation_crc@primary-rotation-90:
>        shard-skl:          NOTRUN -> FAIL (fdo#103925, fdo#107815)
> 
>      igt@kms_setmode@basic:
>        shard-apl:          PASS -> FAIL (fdo#99912)
>        shard-glk:          NOTRUN -> FAIL (fdo#99912)
>        shard-kbl:          PASS -> FAIL (fdo#99912)
> 
>      igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm:
>        shard-kbl:          PASS -> DMESG-WARN (fdo#105345, fdo#103313)
> 
>      igt@pm_rpm@gem-pread:
>        shard-skl:          PASS -> INCOMPLETE (fdo#107807) +1
> 
>      
>      ==== Possible fixes ====
> 
>      igt@kms_busy@extended-pageflip-hang-newfb-render-a:
>        shard-glk:          DMESG-WARN (fdo#107956) -> PASS
> 
>      igt@kms_chv_cursor_fail@pipe-c-256x256-top-edge:
>        shard-skl:          FAIL (fdo#104671) -> PASS
> 
>      igt@kms_color@pipe-c-ctm-blue-to-red:
>        shard-skl:          FAIL (fdo#107201) -> PASS
> 
>      igt@kms_cursor_crc@cursor-128x128-suspend:
>        shard-skl:          INCOMPLETE (fdo#104108) -> PASS
> 
>      igt@kms_cursor_crc@cursor-256x256-suspend:
>        shard-apl:          FAIL (fdo#103191, fdo#103232) -> PASS
> 
>      igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-render:
>        shard-glk:          FAIL (fdo#103167) -> PASS
> 
>      igt@kms_plane@pixel-format-pipe-b-planes:
>        shard-apl:          FAIL (fdo#103166) -> PASS
> 
>      igt@perf@polling:
>        shard-hsw:          FAIL (fdo#102252) -> PASS
> 
>      igt@pm_rpm@basic-rte:
>        shard-skl:          INCOMPLETE (fdo#107807) -> PASS
> 
>      
>    {name}: This element is suppressed. This means it is ignored when computing
>            the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>    fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
>    fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
>    fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
>    fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
>    fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
>    fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
>    fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
>    fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
>    fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
>    fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
>    fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
>    fdo#105345 https://bugs.freedesktop.org/show_bug.cgi?id=105345
>    fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
>    fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
>    fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
>    fdo#106885 https://bugs.freedesktop.org/show_bug.cgi?id=106885
>    fdo#107201 https://bugs.freedesktop.org/show_bug.cgi?id=107201
>    fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
>    fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
>    fdo#107882 https://bugs.freedesktop.org/show_bug.cgi?id=107882
>    fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
>    fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
>    fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
> 
> 
> == Participating hosts (6 -> 6) ==
> 
>    No changes in participating hosts
> 
> 
> == Build changes ==
> 
>      * Linux: CI_DRM_5108 -> Patchwork_10784
> 
>    CI_DRM_5108: a7129b236bba4796c5cbc88cb99d815532b186c0 @ git://anongit.freedesktop.org/gfx-ci/linux
>    IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>    Patchwork_10784: ad3ee2266cea441add075c7833ed677e8d5270b2 @ 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_10784/shards.html
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_query.c b/drivers/gpu/drm/i915/i915_query.c
index 5821002cad42..6fc4b8eeab42 100644
--- a/drivers/gpu/drm/i915/i915_query.c
+++ b/drivers/gpu/drm/i915/i915_query.c
@@ -27,8 +27,7 @@  static int query_topology_info(struct drm_i915_private *dev_priv,
 
 	slice_length = sizeof(sseu->slice_mask);
 	subslice_length = sseu->max_slices *
-		DIV_ROUND_UP(sseu->max_subslices,
-			     BITS_PER_TYPE(sseu->subslice_mask[0]));
+		DIV_ROUND_UP(sseu->max_subslices, BITS_PER_BYTE);
 	eu_length = sseu->max_slices * sseu->max_subslices *
 		DIV_ROUND_UP(sseu->max_eus_per_subslice, BITS_PER_BYTE);