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

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Tue, 20 Sep 2011 12:04:45 -0500

On Tue, 20 Sep 2011 12:28:49 -0400, John Scipione wrote:
On Tue, Sep 20, 2011 at 8:47 AM,  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

1) We detect all the attached monitors.

2) If we find 0 attached displays, we loop over the connectors until we find the first non TV connector, we set that statically as the first display and break.

That code isn't called unless we find 0 monitors.. If 0 displays were found,
the user would be presented with a black screen.

Look at this as one last vain attempt to get a working monitor :)

In the future (when my EDID code is working), if no displays are detected
it may be sane to grab the first TV out connector as they may just have
a composite / component connection which wouldn't have edid.

With AtomBIOS, we have look for valid edid data on each connector to detect
attached monitors.

Also keep in mind I am designing this to work with monitor changes. Any time
detect_displays is called we will re-probe and repopulate the detected
displays using the connector information which will never change. This makes it
possible to have a 'Detect Displays' button in the gui someday.

Thanks!
 --- Alex

Other related posts: