diff options
author | Patrik Jakobsson <patrik.r.jakobsson@gmail.com> | 2011-12-19 21:41:33 (GMT) |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-20 10:23:17 (GMT) |
commit | 9bd81acdb648509dbbc32d4da0477c9fae0d6a73 (patch) | |
tree | adfeea49b91ed3c7bf1590db3f0a331ab4ef1e98 /drivers/gpu/drm/gma500/oaktrail_hdmi.c | |
parent | a12d6a078e47e244a476b67c3f4b6ca03c138a99 (diff) | |
download | linux-9bd81acdb648509dbbc32d4da0477c9fae0d6a73.tar.xz |
gma500: Convert Oaktrail to work with new output handling
Replace psb_intel_output with psb_intel_encoder and psb_intel_connector
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
[Changed Moorestown reference to Oaktrail]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/oaktrail_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_hdmi.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index 6f423c0..36878a6 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c @@ -643,29 +643,33 @@ static const struct drm_encoder_funcs oaktrail_hdmi_enc_funcs = { void oaktrail_hdmi_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev) { - struct psb_intel_output *psb_intel_output; + struct psb_intel_encoder *psb_intel_encoder; + struct psb_intel_connector *psb_intel_connector; struct drm_connector *connector; struct drm_encoder *encoder; - psb_intel_output = kzalloc(sizeof(struct psb_intel_output), GFP_KERNEL); - if (!psb_intel_output) + psb_intel_encoder = kzalloc(sizeof(struct psb_intel_encoder), GFP_KERNEL); + if (!psb_intel_encoder) return; - psb_intel_output->mode_dev = mode_dev; - connector = &psb_intel_output->base; - encoder = &psb_intel_output->enc; - drm_connector_init(dev, &psb_intel_output->base, + psb_intel_connector = kzalloc(sizeof(struct psb_intel_connector), GFP_KERNEL); + if (!psb_intel_connector) + goto failed_connector; + + connector = &psb_intel_connector->base; + encoder = &psb_intel_encoder->base; + drm_connector_init(dev, connector, &oaktrail_hdmi_connector_funcs, DRM_MODE_CONNECTOR_DVID); - drm_encoder_init(dev, &psb_intel_output->enc, + drm_encoder_init(dev, encoder, &oaktrail_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS); - drm_mode_connector_attach_encoder(&psb_intel_output->base, - &psb_intel_output->enc); + psb_intel_connector_attach_encoder(psb_intel_connector, + psb_intel_encoder); - psb_intel_output->type = INTEL_OUTPUT_HDMI; + psb_intel_encoder->type = INTEL_OUTPUT_HDMI; drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs); drm_connector_helper_add(connector, &oaktrail_hdmi_connector_helper_funcs); @@ -675,6 +679,9 @@ void oaktrail_hdmi_init(struct drm_device *dev, drm_sysfs_connector_add(connector); return; + +failed_connector: + kfree(psb_intel_encoder); } static DEFINE_PCI_DEVICE_TABLE(hdmi_ids) = { |