[Intel-gfx] [PATCH] drm/i915: Read the Base of Stolen Memory for 915gm
Paul Menzel
paulepanter at users.sourceforge.net
Sun Feb 10 23:37:03 CET 2013
Am Sonntag, den 10.02.2013, 19:38 +0000 schrieb Chris Wilson:
> Reading the cspec pays dividends once again, as I found the 'Base of
> Stolen Memory' config register so that we can skip the fragile
> computation from Top of Usable Draw and use the real value provided by
> the BIOS.
Nice find. What is the expected functionality change as the code
beforehand was a no-op due to the `if 0`?
If testing is needed, how can this be tested?
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_gem_stolen.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index 130d1db..7f1735c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -72,13 +72,10 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
> } else if (INTEL_INFO(dev)->gen > 3 || IS_G33(dev)) {
> /* Read Graphics Base of Stolen Memory directly */
> pci_read_config_dword(pdev, 0xA4, &base);
> -#if 0
> } else if (IS_GEN3(dev)) {
> - u8 val;
> - /* Stolen is immediately below Top of Low Usable DRAM */
> - pci_read_config_byte(pdev, 0x9c, &val);
> - base = val >> 3 << 27;
> - base -= dev_priv->mm.gtt->stolen_size;
> + /* Read D2:F0 Base of Stolen Memory directly */
> + pci_read_config_dword(dev->pdev, 0x5c, &base);
Should macros be defined for the register names?
> +#if 0
> } else {
> /* Stolen is immediately above Top of Memory */
> base = max_low_pfn_mapped << PAGE_SHIFT;
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20130210/54541464/attachment.sig>
More information about the Intel-gfx
mailing list