Commit c0864cb39c68696e80657360eba63da5e743b7aa

Authored by Jesse Barnes
Committed by Keith Packard
1 parent 45187ace97

drm/i915/hdmi: HDMI source product description infoframe support

Set an SPD infoframe if the sink supports it.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>

Showing 2 changed files with 37 additions and 0 deletions Side-by-side Diff

drivers/gpu/drm/i915/intel_drv.h
... ... @@ -184,6 +184,22 @@
184 184 #define DIP_VERSION_AVI 0x2
185 185 #define DIP_LEN_AVI 13
186 186  
  187 +#define DIP_TYPE_SPD 0x3
  188 +#define DIP_VERSION_SPD 0x1
  189 +#define DIP_LEN_SPD 25
  190 +#define DIP_SPD_UNKNOWN 0
  191 +#define DIP_SPD_DSTB 0x1
  192 +#define DIP_SPD_DVDP 0x2
  193 +#define DIP_SPD_DVHS 0x3
  194 +#define DIP_SPD_HDDVR 0x4
  195 +#define DIP_SPD_DVC 0x5
  196 +#define DIP_SPD_DSC 0x6
  197 +#define DIP_SPD_VCD 0x7
  198 +#define DIP_SPD_GAME 0x8
  199 +#define DIP_SPD_PC 0x9
  200 +#define DIP_SPD_BD 0xa
  201 +#define DIP_SPD_SCD 0xb
  202 +
187 203 struct dip_infoframe {
188 204 uint8_t type; /* HB0 */
189 205 uint8_t ver; /* HB1 */
... ... @@ -208,6 +224,11 @@
208 224 uint16_t left_bar_end;
209 225 uint16_t right_bar_start;
210 226 } avi;
  227 + struct {
  228 + uint8_t vn[8];
  229 + uint8_t pd[16];
  230 + uint8_t sdi;
  231 + } spd;
211 232 uint8_t payload[27];
212 233 } __attribute__ ((packed)) body;
213 234 } __attribute__((packed));
drivers/gpu/drm/i915/intel_hdmi.c
... ... @@ -201,6 +201,21 @@
201 201 intel_set_infoframe(encoder, &avi_if);
202 202 }
203 203  
  204 +static void intel_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
  205 +{
  206 + struct dip_infoframe spd_if;
  207 +
  208 + memset(&spd_if, 0, sizeof(spd_if));
  209 + spd_if.type = DIP_TYPE_SPD;
  210 + spd_if.ver = DIP_VERSION_SPD;
  211 + spd_if.len = DIP_LEN_SPD;
  212 + strcpy(spd_if.body.spd.vn, "Intel");
  213 + strcpy(spd_if.body.spd.pd, "Integrated gfx");
  214 + spd_if.body.spd.sdi = DIP_SPD_PC;
  215 +
  216 + intel_set_infoframe(encoder, &spd_if);
  217 +}
  218 +
204 219 static void intel_hdmi_mode_set(struct drm_encoder *encoder,
205 220 struct drm_display_mode *mode,
206 221 struct drm_display_mode *adjusted_mode)
... ... @@ -245,6 +260,7 @@
245 260 POSTING_READ(intel_hdmi->sdvox_reg);
246 261  
247 262 intel_hdmi_set_avi_infoframe(encoder);
  263 + intel_hdmi_set_spd_infoframe(encoder);
248 264 }
249 265  
250 266 static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)