In sys/dev/pci/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c,
the function dml20_ModeSupportAndSystemConfigurationFull has the
following code:
(link to code location:
https://github.com/openbsd/src/blob/master/sys/dev/pci/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c#L4257)

/*DSC Delay per state*/

for (i = 0; i <= mode_lib->vba.soc.num_states; i++) {
  for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
    if (mode_lib->vba.BlendingAndTiming[k] != k) {
      mode_lib->vba.slices = 0;
    } else if (locals->RequiresDSC[i][k] == 0
    || locals->RequiresDSC[i][k] == false) {
      mode_lib->vba.slices = 0;
    }
    ...

    if (locals->RequiresDSC[i][k] == true && mode_lib->vba.bpp != 0.0) {
        dml_ceil(mode_lib->vba.HActive[k] / mode_lib->vba.slices, 1.0);
    }
    ...

The variable mode_lib->vba.slices is used as a divisor, but its value
may be equal to zero, leading to a divide by zero problem.

Similar issues also appear in the file display_mode_vba_20v2.c and
display_mode_vba_21.c.

Reply via email to