aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-11-29 17:27:45 -0500
committerDave Airlie <airlied@redhat.com>2011-12-06 04:55:41 -0500
commitaa0c45fdca0cff3d1ba06578a84c9bc7f29a0960 (patch)
treeed2b380de5668f7b7d8ee87b8433ef2082924ef4
parent1b223c9ebf11e9597820fac57b211709f8ffce26 (diff)
gma500: Fix oaktrail probing part 1
The Oaktrail platform does not use the GCT/VBT format that is used by the Moorestowm (non PC legacy) equivalent device. It uses the BIOS tables which means an opregion and the like. The current code uses the wrong table which breaks things like the Fujitsu q550 tablets. Fix the table usage as a first step. The problem was found and diagnosed by Chia-I Wu Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/gma500/mid_bios.c6
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_device.c18
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
index 018ab469772e..128e6bb37568 100644
--- a/drivers/gpu/drm/gma500/mid_bios.c
+++ b/drivers/gpu/drm/gma500/mid_bios.c
@@ -142,6 +142,12 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
142 memcpy(vbt, vbt_virtual, sizeof(*vbt)); 142 memcpy(vbt, vbt_virtual, sizeof(*vbt));
143 iounmap(vbt_virtual); /* Free virtual address space */ 143 iounmap(vbt_virtual); /* Free virtual address space */
144 144
145 /* No matching signature don't process the data */
146 if (memcmp(vbt->signature, "$GCT", 4)) {
147 vbt->size = 0;
148 return;
149 }
150
145 dev_dbg(dev->dev, "GCT revision is %x\n", vbt->revision); 151 dev_dbg(dev->dev, "GCT revision is %x\n", vbt->revision);
146 152
147 switch (vbt->revision) { 153 switch (vbt->revision) {
diff --git a/drivers/gpu/drm/gma500/oaktrail_device.c b/drivers/gpu/drm/gma500/oaktrail_device.c
index 57ad3ea62be2..c1ffb113958b 100644
--- a/drivers/gpu/drm/gma500/oaktrail_device.c
+++ b/drivers/gpu/drm/gma500/oaktrail_device.c
@@ -29,6 +29,7 @@
29#include <asm/mrst.h> 29#include <asm/mrst.h>
30#include <asm/intel_scu_ipc.h> 30#include <asm/intel_scu_ipc.h>
31#include "mid_bios.h" 31#include "mid_bios.h"
32#include "intel_bios.h"
32 33
33static int oaktrail_output_init(struct drm_device *dev) 34static int oaktrail_output_init(struct drm_device *dev)
34{ 35{
@@ -456,9 +457,24 @@ static int oaktrail_power_up(struct drm_device *dev)
456} 457}
457 458
458 459
460static void oaktrail_chip_setup(struct drm_device *dev)
461{
462 int ret = mid_chip_setup(dev);
463 if (ret < 0)
464 return ret;
465 if (vbt->size == 0) {
466 /* Now pull the BIOS data */
467 gma_intel_opregion_init(dev);
468 psb_intel_init_bios(dev);
469 }
470 return 0;
471}
472
459static void oaktrail_teardown(struct drm_device *dev) 473static void oaktrail_teardown(struct drm_device *dev)
460{ 474{
461 oaktrail_hdmi_teardown(dev); 475 oaktrail_hdmi_teardown(dev);
476 if (vbt->size == 0)
477 psb_intel_destroy_bios(dev);
462} 478}
463 479
464const struct psb_ops oaktrail_chip_ops = { 480const struct psb_ops oaktrail_chip_ops = {
@@ -468,7 +484,7 @@ const struct psb_ops oaktrail_chip_ops = {
468 .crtcs = 2, 484 .crtcs = 2,
469 .sgx_offset = MRST_SGX_OFFSET, 485 .sgx_offset = MRST_SGX_OFFSET,
470 486
471 .chip_setup = mid_chip_setup, 487 .chip_setup = oaktrail_chip_setup,
472 .chip_teardown = oaktrail_teardown, 488 .chip_teardown = oaktrail_teardown,
473 .crtc_helper = &oaktrail_helper_funcs, 489 .crtc_helper = &oaktrail_helper_funcs,
474 .crtc_funcs = &psb_intel_crtc_funcs, 490 .crtc_funcs = &psb_intel_crtc_funcs,