[haiku-commits] Re: r42760 - haiku/trunk/src/add-ons/accelerants/radeon_hd

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 20 Sep 2011 12:28:49 -0400

On Tue, Sep 20, 2011 at 8:47 AM, <kallisti5@xxxxxxxxxxx> wrote:

> +               for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) {
> +                       // skip TV DAC connectors as likely fallback isn't
> for TV
> +                       if (gConnector[id]->encoder_type ==
> VIDEO_ENCODER_TVDAC)
> +                               continue;
> +                       gDisplay[0]->active = true;
> +                       gDisplay[0]->connector_index = id;
> +                       init_registers(gDisplay[0]->regs, 0);
> +                       if (detect_crt_ranges(0) == B_OK)
> +                               gDisplay[0]->found_ranges = true;
> +                       break;
> +               }
>        }
>

I don't understand this at all. You are looping through the supported
devices only to check id once to see if it is equal to VIDEO_ENCODER_TVDAC
and skip it and then in the next loop iteration you set the display to
gDisplay[0] and break out of the loop? Did you mean to set it to
gDisplay[id]? If not, why have a loop here at all if you are just going to
set gDisplay[0] active anyway?

John Scipione

Other related posts: