[haiku-commits] Re: r42662 - haiku/trunk/headers/private/graphics/common

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Sun, 21 Aug 2011 12:00:12 -0500

On Sun, 21 Aug 2011 18:20:42 +0200, Axel Dörfler wrote:
On 08/21/2011 06:00 PM, kallisti5@xxxxxxxxxxx wrote:
Author: kallisti5
Date: 2011-08-21 18:00:45 +0200 (Sun, 21 Aug 2011)
New Revision: 42662
Changeset: https://dev.haiku-os.org/changeset/42662

Added:
    haiku/trunk/headers/private/graphics/common/video_electronics.h
Log:
* add a new generic video electronics define,
   this seems like it could be useful for more then
   just radeon_hd.
* idea from linux drm driver
* feedback / flames welcome

You son of a ... oh, you asked for feedback ;-)

LOL :)

Added: haiku/trunk/headers/private/graphics/common/video_electronics.h

I'm not too fond of the name, but I don't really have a better
suggestion either.

Yeah, I asked in IRC and no one could come up with anything better.

+const struct video_connectors {
+       uint32      type;
+       const char* name;
+} kVideoConnector[] = {

This way, you can only include this header once per component, or
you'll get linker errors since you define the kVideoConnector symbol
more than once.
Instead, this should be moved to a .c(pp) file. I would also probably
just add a function that returns this string instead of having each
user look it up in there.

+const struct video_encoders {
+       uint32      type;
+       const char* name;
+} kVideoEncoder[] = {

Same here.


Ahh.. didn't think about that... will add a .c to accelerants/common
to decode each

I assume this is mostly for debugging/reporting? At least I wouldn't
have another idea. In any case, the header fits right in there IMO.

radeon_hd cards want you to map out possible connectors, then run detection
on each connector already knowing information about its existence.

In the future, if we want to access better information about video card monitor
connections, etc... it would be nice to have a common lingo.

For example, for radeon_hd I am planning something along the lines of:

 monitor[crtc_id 0]
   Connector = VIDEO_CONNECTOR_VGA
   Encoder = VIDEO_ENCODER_PLL
   Encoder_ID = 0 // PLL_A
   mode
   etc.
 monitor[crtc_id 1]
   etc..

For now the monitor info struct will remain within radeon_hd per card...
maybe in the future a system side wide once would be a positive thing.


Thanks!
 -- Alex

Other related posts: