Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Dave Airlie
aa0c45fd 1b223c9e

+23 -1
+6
drivers/gpu/drm/gma500/mid_bios.c
··· 142 142 memcpy(vbt, vbt_virtual, sizeof(*vbt)); 143 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 151 dev_dbg(dev->dev, "GCT revision is %x\n", vbt->revision); 146 152 147 153 switch (vbt->revision) {
+17 -1
drivers/gpu/drm/gma500/oaktrail_device.c
··· 29 29 #include <asm/mrst.h> 30 30 #include <asm/intel_scu_ipc.h> 31 31 #include "mid_bios.h" 32 + #include "intel_bios.h" 32 33 33 34 static int oaktrail_output_init(struct drm_device *dev) 34 35 { ··· 457 456 } 458 457 459 458 459 + static void oaktrail_chip_setup(struct drm_device *dev) 460 + { 461 + int ret = mid_chip_setup(dev); 462 + if (ret < 0) 463 + return ret; 464 + if (vbt->size == 0) { 465 + /* Now pull the BIOS data */ 466 + gma_intel_opregion_init(dev); 467 + psb_intel_init_bios(dev); 468 + } 469 + return 0; 470 + } 471 + 460 472 static void oaktrail_teardown(struct drm_device *dev) 461 473 { 462 474 oaktrail_hdmi_teardown(dev); 475 + if (vbt->size == 0) 476 + psb_intel_destroy_bios(dev); 463 477 } 464 478 465 479 const struct psb_ops oaktrail_chip_ops = { ··· 484 468 .crtcs = 2, 485 469 .sgx_offset = MRST_SGX_OFFSET, 486 470 487 - .chip_setup = mid_chip_setup, 471 + .chip_setup = oaktrail_chip_setup, 488 472 .chip_teardown = oaktrail_teardown, 489 473 .crtc_helper = &oaktrail_helper_funcs, 490 474 .crtc_funcs = &psb_intel_crtc_funcs,