Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dcb.h
Go to the documentation of this file.
1 #ifndef __NVBIOS_DCB_H__
2 #define __NVBIOS_DCB_H__
3 
4 struct nouveau_bios;
5 
8  DCB_OUTPUT_TV = 0x1,
15 };
16 
17 struct dcb_output {
18  int index; /* may not be raw dcb index if merging has happened */
27  union {
28  struct sor_conf {
29  int link;
30  } sorconf;
31  struct {
32  int maxfreq;
33  } crtconf;
34  struct {
35  struct sor_conf sor;
39  } lvdsconf;
40  struct {
42  } tvconf;
43  struct {
44  struct sor_conf sor;
45  int link_nr;
46  int link_bw;
47  } dpconf;
48  struct {
49  struct sor_conf sor;
51  } tmdsconf;
52  };
54 };
55 
56 u16 dcb_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *ent, u8 *len);
57 u16 dcb_outp(struct nouveau_bios *, u8 idx, u8 *ver, u8 *len);
58 int dcb_outp_foreach(struct nouveau_bios *, void *data, int (*exec)
59  (struct nouveau_bios *, void *, int index, u16 entry));
60 
61 
62 /* BIT 'U'/'d' table encoder subtables have hashes matching them to
63  * a particular set of encoders.
64  *
65  * This function returns true if a particular DCB entry matches.
66  */
67 static inline bool
68 dcb_hash_match(struct dcb_output *dcb, u32 hash)
69 {
70  if ((hash & 0x000000f0) != (dcb->location << 4))
71  return false;
72  if ((hash & 0x0000000f) != dcb->type)
73  return false;
74  if (!(hash & (dcb->or << 16)))
75  return false;
76 
77  switch (dcb->type) {
78  case DCB_OUTPUT_TMDS:
79  case DCB_OUTPUT_LVDS:
80  case DCB_OUTPUT_DP:
81  if (hash & 0x00c00000) {
82  if (!(hash & (dcb->sorconf.link << 22)))
83  return false;
84  }
85  default:
86  return true;
87  }
88 }
89 
90 #endif