All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>
Subject: [PATCH 06/17] drm/amdgpu: add support for extended stolen vga memory
Date: Wed, 29 Jul 2020 13:34:28 -0400	[thread overview]
Message-ID: <20200729173439.3698-7-alexander.deucher@amd.com> (raw)
In-Reply-To: <20200729173439.3698-1-alexander.deucher@amd.com>

This will allow us to split the allocation for systems
where we have to keep the stolen memory around to avoid
S3 issues.  This way we don't waste as much memory and
still avoid any screen artifacts during the bios to
driver transition.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 +++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
index 0cf18f01e67a..8f4af955d72c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
@@ -215,6 +215,8 @@ struct amdgpu_gmc {
 	bool			prt_warning;
 	uint64_t		stolen_vga_size;
 	struct amdgpu_bo	*stolen_vga_memory;
+	uint64_t		stolen_extended_size;
+	struct amdgpu_bo	*stolen_extended_memory;
 	bool			keep_stolen_vga_memory;
 	uint32_t		sdpif_register;
 	/* apertures */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index fd61769202b3..ec975251b171 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1915,7 +1915,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
 	uint64_t gtt_size;
 	int r;
 	u64 vis_vram_limit;
-	void *stolen_vga_buf;
+	void *stolen_vga_buf, *stolen_extended_buf;
 
 	mutex_init(&adev->mman.gtt_window_lock);
 
@@ -1985,6 +1985,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
 				       &stolen_vga_buf);
 	if (r)
 		return r;
+	r = amdgpu_bo_create_kernel_at(adev, adev->gmc.stolen_vga_size,
+				       adev->gmc.stolen_extended_size,
+				       AMDGPU_GEM_DOMAIN_VRAM,
+				       &adev->gmc.stolen_extended_memory,
+				       &stolen_extended_buf);
+	if (r)
+		return r;
 
 	DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
 		 (unsigned) (adev->gmc.real_vram_size / (1024 * 1024)));
@@ -2041,11 +2048,13 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
  */
 void amdgpu_ttm_late_init(struct amdgpu_device *adev)
 {
-	void *stolen_vga_buf;
+	void *stolen_vga_buf, *stolen_extended_buf;
 
 	/* return the VGA stolen memory (if any) back to VRAM */
 	if (!adev->gmc.keep_stolen_vga_memory)
 		amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
+	amdgpu_bo_free_kernel(&adev->gmc.stolen_extended_memory, NULL,
+			      &stolen_extended_buf);
 }
 
 /**
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-07-29 17:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 17:34 [PATCH 00/17] rework stolen pre-OS fb allocation handling (v2) Alex Deucher
2020-07-29 17:34 ` [PATCH 01/17] drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at (v2) Alex Deucher
2020-07-29 17:34 ` [PATCH 02/17] drm/amdgpu: use create_at for the stolen pre-OS buffer Alex Deucher
2020-07-29 17:34 ` [PATCH 03/17] drm/amdgpu: use a define for the memory size of the vga emulator Alex Deucher
2020-07-29 17:34 ` [PATCH 04/17] drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc Alex Deucher
2020-07-29 17:34 ` [PATCH 05/17] drm/amdgpu: move keep stolen memory check into gmc core Alex Deucher
2020-07-29 17:34 ` Alex Deucher [this message]
2020-07-29 17:34 ` [PATCH 07/17] drm/amdgpu/gmc: add new helper to get the FB size used by pre-OS console Alex Deucher
2020-07-29 17:34 ` [PATCH 08/17] drm/amdgpu/gmc6: switch to using amdgpu_gmc_get_vbios_allocations Alex Deucher
2020-07-29 17:34 ` [PATCH 09/17] drm/amdgpu/gmc7: " Alex Deucher
2020-07-29 17:34 ` [PATCH 10/17] drm/amdgpu/gmc8: " Alex Deucher
2020-07-29 17:34 ` [PATCH 11/17] drm/amdgpu/gmc9: " Alex Deucher
2020-07-29 17:34 ` [PATCH 12/17] drm/amdgpu/gmc10: " Alex Deucher
2020-07-29 17:34 ` [PATCH 13/17] drm/amdgpu: drop the CPU pointers for the stolen vga bos Alex Deucher
2020-07-29 17:34 ` [PATCH 14/17] drm/amdgpu/gmc: disable keep_stolen_vga_memory on arcturus Alex Deucher
2020-07-29 17:34 ` [PATCH 15/17] drm/amdgpu: move stolen memory from gmc to mman Alex Deucher
2020-07-29 17:34 ` [PATCH 16/17] drm/amdgpu: move IP discovery data " Alex Deucher
2020-07-29 17:34 ` [PATCH 17/17] drm/amdgpu: move vram usage by vbios " Alex Deucher
2020-07-30  9:13   ` Christian König
2020-07-30  9:14 ` [PATCH 00/17] rework stolen pre-OS fb allocation handling (v2) Christian König
2020-07-30 20:03 [PATCH 00/17] rework stolen pre-OS fb allocation handling (v3) Alex Deucher
2020-07-30 20:04 ` [PATCH 06/17] drm/amdgpu: add support for extended stolen vga memory Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200729173439.3698-7-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.