diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2014-01-09 13:02:46 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-24 08:47:39 -0400 |
commit | 663750141ed953c42b6b0e3cfb2450453bc38151 (patch) | |
tree | e5d875ae7f8cfcf45720e4dafb1cd7e7c6b77226 /arch | |
parent | 1b1aad754cb26fd073b82eb860126cb812157ae9 (diff) |
drm/i915/skl: Add the additional graphics stolen sizes
Skylake introduces new stolen memory sizes starting at 0xf0 (4MB) and
growing by 4MB increments from there.
v2: Rebase on top of the early-quirk changes from Ville.
v3: Rebase on top of the PCI_IDS/IDS macro rename
Reviewed-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/early-quirks.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 2e1a6853e00c..fe9f0b79a18b 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -455,6 +455,23 @@ struct intel_stolen_funcs { | |||
455 | u32 (*base)(int num, int slot, int func, size_t size); | 455 | u32 (*base)(int num, int slot, int func, size_t size); |
456 | }; | 456 | }; |
457 | 457 | ||
458 | static size_t __init gen9_stolen_size(int num, int slot, int func) | ||
459 | { | ||
460 | u16 gmch_ctrl; | ||
461 | |||
462 | gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); | ||
463 | gmch_ctrl >>= BDW_GMCH_GMS_SHIFT; | ||
464 | gmch_ctrl &= BDW_GMCH_GMS_MASK; | ||
465 | |||
466 | if (gmch_ctrl < 0xf0) | ||
467 | return gmch_ctrl << 25; /* 32 MB units */ | ||
468 | else | ||
469 | /* 4MB increments starting at 0xf0 for 4MB */ | ||
470 | return (gmch_ctrl - 0xf0 + 1) << 22; | ||
471 | } | ||
472 | |||
473 | typedef size_t (*stolen_size_fn)(int num, int slot, int func); | ||
474 | |||
458 | static const struct intel_stolen_funcs i830_stolen_funcs __initconst = { | 475 | static const struct intel_stolen_funcs i830_stolen_funcs __initconst = { |
459 | .base = i830_stolen_base, | 476 | .base = i830_stolen_base, |
460 | .size = i830_stolen_size, | 477 | .size = i830_stolen_size, |
@@ -490,6 +507,11 @@ static const struct intel_stolen_funcs gen8_stolen_funcs __initconst = { | |||
490 | .size = gen8_stolen_size, | 507 | .size = gen8_stolen_size, |
491 | }; | 508 | }; |
492 | 509 | ||
510 | static const struct intel_stolen_funcs gen9_stolen_funcs __initconst = { | ||
511 | .base = intel_stolen_base, | ||
512 | .size = gen9_stolen_size, | ||
513 | }; | ||
514 | |||
493 | static const struct intel_stolen_funcs chv_stolen_funcs __initconst = { | 515 | static const struct intel_stolen_funcs chv_stolen_funcs __initconst = { |
494 | .base = intel_stolen_base, | 516 | .base = intel_stolen_base, |
495 | .size = chv_stolen_size, | 517 | .size = chv_stolen_size, |
@@ -523,6 +545,7 @@ static const struct pci_device_id intel_stolen_ids[] __initconst = { | |||
523 | INTEL_BDW_M_IDS(&gen8_stolen_funcs), | 545 | INTEL_BDW_M_IDS(&gen8_stolen_funcs), |
524 | INTEL_BDW_D_IDS(&gen8_stolen_funcs), | 546 | INTEL_BDW_D_IDS(&gen8_stolen_funcs), |
525 | INTEL_CHV_IDS(&chv_stolen_funcs), | 547 | INTEL_CHV_IDS(&chv_stolen_funcs), |
548 | INTEL_SKL_IDS(&gen9_stolen_funcs), | ||
526 | }; | 549 | }; |
527 | 550 | ||
528 | static void __init intel_graphics_stolen(int num, int slot, int func) | 551 | static void __init intel_graphics_stolen(int num, int slot, int func) |