aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2011-12-19 16:40:33 -0500
committerDave Airlie <airlied@redhat.com>2011-12-20 05:23:07 -0500
commit1730f89bfcff353484672cdcefbef13b2f374176 (patch)
treeac13c154f05e05cc527df52dce8fb5caa7826c03
parent352b16a0e16eb29fd268dafab7816bf85bfc4d21 (diff)
gma500: Fix encoder type checking for connectors
Fix cases where we need to know what encoder type is behind a given connector. Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c8
-rw-r--r--drivers/gpu/drm/gma500/psb_drv.c6
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_display.c24
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 75cfafe2ff81..791c0ef1a65b 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -747,13 +747,13 @@ static void psb_setup_outputs(struct drm_device *dev)
747 747
748 list_for_each_entry(connector, &dev->mode_config.connector_list, 748 list_for_each_entry(connector, &dev->mode_config.connector_list,
749 head) { 749 head) {
750 struct psb_intel_output *psb_intel_output = 750 struct psb_intel_encoder *psb_intel_encoder =
751 to_psb_intel_output(connector); 751 psb_intel_attached_encoder(connector);
752 struct drm_encoder *encoder = &psb_intel_output->enc; 752 struct drm_encoder *encoder = &psb_intel_encoder->base;
753 int crtc_mask = 0, clone_mask = 0; 753 int crtc_mask = 0, clone_mask = 0;
754 754
755 /* valid crtcs */ 755 /* valid crtcs */
756 switch (psb_intel_output->type) { 756 switch (psb_intel_encoder->type) {
757 case INTEL_OUTPUT_ANALOG: 757 case INTEL_OUTPUT_ANALOG:
758 crtc_mask = (1 << 0); 758 crtc_mask = (1 << 0);
759 clone_mask = (1 << INTEL_OUTPUT_ANALOG); 759 clone_mask = (1 << INTEL_OUTPUT_ANALOG);
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index add3156cd8bf..b4aee0ac2dfd 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -276,7 +276,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
276 int ret = -ENOMEM; 276 int ret = -ENOMEM;
277 uint32_t tt_pages; 277 uint32_t tt_pages;
278 struct drm_connector *connector; 278 struct drm_connector *connector;
279 struct psb_intel_output *psb_intel_output; 279 struct psb_intel_encoder *psb_intel_encoder;
280 280
281 dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL); 281 dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
282 if (dev_priv == NULL) 282 if (dev_priv == NULL)
@@ -390,9 +390,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
390 /* Only add backlight support if we have LVDS output */ 390 /* Only add backlight support if we have LVDS output */
391 list_for_each_entry(connector, &dev->mode_config.connector_list, 391 list_for_each_entry(connector, &dev->mode_config.connector_list,
392 head) { 392 head) {
393 psb_intel_output = to_psb_intel_output(connector); 393 psb_intel_encoder = psb_intel_attached_encoder(connector);
394 394
395 switch (psb_intel_output->type) { 395 switch (psb_intel_encoder->type) {
396 case INTEL_OUTPUT_LVDS: 396 case INTEL_OUTPUT_LVDS:
397 case INTEL_OUTPUT_MIPI: 397 case INTEL_OUTPUT_MIPI:
398 ret = gma_backlight_init(dev); 398 ret = gma_backlight_init(dev);
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c
index b6f6cf589739..ddaf3d428f55 100644
--- a/drivers/gpu/drm/gma500/psb_intel_display.c
+++ b/drivers/gpu/drm/gma500/psb_intel_display.c
@@ -214,9 +214,9 @@ bool psb_intel_pipe_has_type(struct drm_crtc *crtc, int type)
214 214
215 list_for_each_entry(l_entry, &mode_config->connector_list, head) { 215 list_for_each_entry(l_entry, &mode_config->connector_list, head) {
216 if (l_entry->encoder && l_entry->encoder->crtc == crtc) { 216 if (l_entry->encoder && l_entry->encoder->crtc == crtc) {
217 struct psb_intel_output *psb_intel_output = 217 struct psb_intel_encoder *psb_intel_encoder =
218 to_psb_intel_output(l_entry); 218 psb_intel_attached_encoder(l_entry);
219 if (psb_intel_output->type == type) 219 if (psb_intel_encoder->type == type)
220 return true; 220 return true;
221 } 221 }
222 } 222 }
@@ -615,14 +615,14 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,
615 } 615 }
616 616
617 list_for_each_entry(connector, &mode_config->connector_list, head) { 617 list_for_each_entry(connector, &mode_config->connector_list, head) {
618 struct psb_intel_output *psb_intel_output = 618 struct psb_intel_encoder *psb_intel_encoder =
619 to_psb_intel_output(connector); 619 psb_intel_attached_encoder(connector);
620 620
621 if (!connector->encoder 621 if (!connector->encoder
622 || connector->encoder->crtc != crtc) 622 || connector->encoder->crtc != crtc)
623 continue; 623 continue;
624 624
625 switch (psb_intel_output->type) { 625 switch (psb_intel_encoder->type) {
626 case INTEL_OUTPUT_LVDS: 626 case INTEL_OUTPUT_LVDS:
627 is_lvds = true; 627 is_lvds = true;
628 break; 628 break;
@@ -1402,9 +1402,9 @@ int psb_intel_connector_clones(struct drm_device *dev, int type_mask)
1402 1402
1403 list_for_each_entry(connector, &dev->mode_config.connector_list, 1403 list_for_each_entry(connector, &dev->mode_config.connector_list,
1404 head) { 1404 head) {
1405 struct psb_intel_output *psb_intel_output = 1405 struct psb_intel_encoder *psb_intel_encoder =
1406 to_psb_intel_output(connector); 1406 psb_intel_attached_encoder(connector);
1407 if (type_mask & (1 << psb_intel_output->type)) 1407 if (type_mask & (1 << psb_intel_encoder->type))
1408 index_mask |= (1 << entry); 1408 index_mask |= (1 << entry);
1409 entry++; 1409 entry++;
1410 } 1410 }
@@ -1423,10 +1423,10 @@ void psb_intel_modeset_cleanup(struct drm_device *dev)
1423*/ 1423*/
1424struct drm_encoder *psb_intel_best_encoder(struct drm_connector *connector) 1424struct drm_encoder *psb_intel_best_encoder(struct drm_connector *connector)
1425{ 1425{
1426 struct psb_intel_output *psb_intel_output = 1426 struct psb_intel_encoder *psb_intel_encoder =
1427 to_psb_intel_output(connector); 1427 psb_intel_attached_encoder(connector);
1428 1428
1429 return &psb_intel_output->enc; 1429 return &psb_intel_encoder->base;
1430} 1430}
1431 1431
1432void psb_intel_connector_attach_encoder(struct psb_intel_connector *connector, 1432void psb_intel_connector_attach_encoder(struct psb_intel_connector *connector,