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

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 21 Aug 2011 18:20:42 +0200

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 ;-)

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.

+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.

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.

Bye,
   Axel.

Other related posts: