* [bug report] drm/amd/display: Handle HDR use cases.
@ 2018-03-14 8:53 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-03-14 8:53 UTC (permalink / raw)
To: vitaly.prosyak-5C7GfCeVMHo; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hello Vitaly Prosyak,
The patch 44c6f2e59ee8: "drm/amd/display: Handle HDR use cases." from
Feb 13, 2018, leads to the following static checker warning:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:543 cm_helper_translate_curve_to_degamma_hw_format()
warn: potential off by one (named limit 'MAX_REGIONS_NUMBER') 'seg_distr[k]'
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c
530 lut_params->hw_points_num = hw_points;
531
532 i = 1;
533 for (k = 0; k < MAX_REGIONS_NUMBER && i < MAX_REGIONS_NUMBER; k++) {
^^^^^^^^^^^^^^^^^^^^^^
Imagine we hit this limit and k == MAX_REGIONS_NUMBER,
534 if (seg_distr[k] != -1) {
535 lut_params->arr_curve_points[k].segments_num =
536 seg_distr[k];
537 lut_params->arr_curve_points[i].offset =
538 lut_params->arr_curve_points[k].offset + (1 << seg_distr[k]);
539 }
540 i++;
541 }
542
543 if (seg_distr[k] != -1)
^^^^^^^^^^^^^^^^^^
then this would be a problem.
544 lut_params->arr_curve_points[k].segments_num = seg_distr[k];
545
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-14 8:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14 8:53 [bug report] drm/amd/display: Handle HDR use cases Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.