[PATCH 2/2] drm/i915: pass ELD to HDMI/DP audio driver

Wu Fengguang fengguang.wu at intel.com
Sun Sep 4 23:50:42 PDT 2011


I'd like to do more cleanups:

> +	int aud_cntl_st;
> +	int aud_cntrl_st2;

s/aud_cntrl_st2/aud_cntl_st2/

> +	if (IS_IVYBRIDGE(connector->dev)) {
> +		hdmiw_hdmiedid = GEN7_HDMIW_HDMIEDID_A;
> +		aud_cntl_st = GEN7_AUD_CNTRL_ST_A;
> +		aud_cntrl_st2 = GEN7_AUD_CNTRL_ST2;
> +	} else {
> +		hdmiw_hdmiedid = GEN5_HDMIW_HDMIEDID_A;
> +		aud_cntl_st = GEN5_AUD_CNTL_ST_A;
> +		aud_cntrl_st2 = GEN5_AUD_CNTL_ST2;
> +	}
> +
> +	i = to_intel_crtc(crtc)->pipe;
> +	hdmiw_hdmiedid += i * 0x100;
> +	aud_cntl_st += i * 0x100;
> +
> +	DRM_DEBUG_DRIVER("ELD on pipe %c\n", pipe_name(i));
[...]
> +	len = min_t(uint8_t, eld[2], 21);	/* 84 bytes of hw ELD buffer */
> +	DRM_DEBUG_DRIVER("ELD size %d\n", len);

Merge the above two DRM_DEBUG_DRIVER() calls into:

+       DRM_DEBUG_DRIVER("writing %d ELD dword(s) on pipe %c\n",
+                        len, pipe_name(to_intel_crtc(crtc)->pipe));

> +	for (i = 0; i < len; i++)
> +		I915_WRITE(hdmiw_hdmiedid, *((uint32_t *)eld + i));

Thanks,
Fengguang


More information about the dri-devel mailing list