All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexdeucher@gmail.com>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH 04/14] drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc
Date: Wed, 29 Jul 2020 10:44:16 +0200	[thread overview]
Message-ID: <021773e5-7d01-7296-2595-6ae9e11e61f8@gmail.com> (raw)
In-Reply-To: <20200728224605.3919-5-alexander.deucher@amd.com>

Am 29.07.20 um 00:45 schrieb Alex Deucher:
> Since that is where we store the other data related to
> the stolen vga memory.

Mhm, how about putting everything into struct amdgpu_mman instead?

This stuff is not at all GMC related as far as I can see.

We just put it into the GMC code because we have all the other memory 
sizes there as well.

Christian.

>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 -
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 +++---
>   drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c  | 2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c   | 2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c   | 2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c   | 2 +-
>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c   | 4 ++--
>   8 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 2a7fbe21619d..899664357015 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -767,7 +767,6 @@ struct amdgpu_device {
>   	bool				is_atom_fw;
>   	uint8_t				*bios;
>   	uint32_t			bios_size;
> -	struct amdgpu_bo		*stolen_vga_memory;
>   	uint32_t			bios_scratch_reg_offset;
>   	uint32_t			bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> index 9d58c56f6cfc..ddb64be670c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
> @@ -213,7 +213,8 @@ struct amdgpu_gmc {
>   	uint8_t			vram_vendor;
>   	uint32_t                srbm_soft_reset;
>   	bool			prt_warning;
> -	uint64_t		stolen_size;
> +	uint64_t		stolen_vga_size;
> +	struct amdgpu_bo	*stolen_vga_memory;
>   	uint32_t		sdpif_register;
>   	/* apertures */
>   	u64			shared_aperture_start;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index a188216bccc2..39781127d059 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1979,9 +1979,9 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
>   	 * This is used for VGA emulation and pre-OS scanout buffers to
>   	 * avoid display artifacts while transitioning between pre-OS
>   	 * and driver.  */
> -	r = amdgpu_bo_create_kernel_at(adev, 0, adev->gmc.stolen_size,
> +	r = amdgpu_bo_create_kernel_at(adev, 0, adev->gmc.stolen_vga_size,
>   				       AMDGPU_GEM_DOMAIN_VRAM,
> -				       &adev->stolen_vga_memory,
> +				       &adev->gmc.stolen_vga_memory,
>   				       &stolen_vga_buf);
>   	if (r)
>   		return r;
> @@ -2043,7 +2043,7 @@ void amdgpu_ttm_late_init(struct amdgpu_device *adev)
>   {
>   	void *stolen_vga_buf;
>   	/* return the VGA stolen memory (if any) back to VRAM */
> -	amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, &stolen_vga_buf);
> +	amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> index 040220e97cf3..337d70503970 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> @@ -812,7 +812,7 @@ static int gmc_v10_0_sw_init(void *handle)
>   	if (r)
>   		return r;
>   
> -	adev->gmc.stolen_size = gmc_v10_0_get_vbios_fb_size(adev);
> +	adev->gmc.stolen_vga_size = gmc_v10_0_get_vbios_fb_size(adev);
>   
>   	/* Memory manager */
>   	r = amdgpu_bo_init(adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> index 4de996868d32..28ddb41a78c8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> @@ -862,7 +862,7 @@ static int gmc_v6_0_sw_init(void *handle)
>   	if (r)
>   		return r;
>   
> -	adev->gmc.stolen_size = gmc_v6_0_get_vbios_fb_size(adev);
> +	adev->gmc.stolen_vga_size = gmc_v6_0_get_vbios_fb_size(adev);
>   
>   	r = amdgpu_bo_init(adev);
>   	if (r)
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index 4113f2d33b75..8b8ecbb99d84 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -1035,7 +1035,7 @@ static int gmc_v7_0_sw_init(void *handle)
>   	if (r)
>   		return r;
>   
> -	adev->gmc.stolen_size = gmc_v7_0_get_vbios_fb_size(adev);
> +	adev->gmc.stolen_vga_size = gmc_v7_0_get_vbios_fb_size(adev);
>   
>   	/* Memory manager */
>   	r = amdgpu_bo_init(adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index f29ff9afcc10..8e3763ec268f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -1160,7 +1160,7 @@ static int gmc_v8_0_sw_init(void *handle)
>   	if (r)
>   		return r;
>   
> -	adev->gmc.stolen_size = gmc_v8_0_get_vbios_fb_size(adev);
> +	adev->gmc.stolen_vga_size = gmc_v8_0_get_vbios_fb_size(adev);
>   
>   	/* Memory manager */
>   	r = amdgpu_bo_init(adev);
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index ac15d7678d24..b66c60680dba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -1243,7 +1243,7 @@ static int gmc_v9_0_sw_init(void *handle)
>   	if (r)
>   		return r;
>   
> -	adev->gmc.stolen_size = gmc_v9_0_get_vbios_fb_size(adev);
> +	adev->gmc.stolen_vga_size = gmc_v9_0_get_vbios_fb_size(adev);
>   
>   	/* Memory manager */
>   	r = amdgpu_bo_init(adev);
> @@ -1282,7 +1282,7 @@ static int gmc_v9_0_sw_fini(void *handle)
>   	amdgpu_vm_manager_fini(adev);
>   
>   	if (gmc_v9_0_keep_stolen_memory(adev))
> -		amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, &stolen_vga_buf);
> +		amdgpu_bo_free_kernel(&adev->gmc.stolen_vga_memory, NULL, &stolen_vga_buf);
>   
>   	amdgpu_gart_table_vram_free(adev);
>   	amdgpu_bo_fini(adev);

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

  reply	other threads:[~2020-07-29  8:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 22:45 [PATCH 00/14] rework stolen pre-OS fb allocation handling Alex Deucher
2020-07-28 22:45 ` [PATCH 01/14] drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at Alex Deucher
2020-07-28 23:35   ` Felix Kuehling
2020-07-29  8:40   ` Christian König
2020-07-28 22:45 ` [PATCH 02/14] drm/amdgpu: use create_at for the stolen pre-OS buffer Alex Deucher
2020-07-28 22:45 ` [PATCH 03/14] drm/amdgpu: use a define for the memory size of the vga emulator Alex Deucher
2020-07-28 22:45 ` [PATCH 04/14] drm/amdgpu: move stolen vga bo from amdgpu to amdgpu.gmc Alex Deucher
2020-07-29  8:44   ` Christian König [this message]
2020-07-28 22:45 ` [PATCH 05/14] drm/amdgpu: move keep stolen memory check into gmc core Alex Deucher
2020-07-28 22:45 ` [PATCH 06/14] drm/amdgpu: add support for extended stolen vga memory Alex Deucher
2020-07-28 22:45 ` [PATCH 07/14] drm/amdgpu/gmc: add new helper to get the FB size used by pre-OS console Alex Deucher
2020-07-28 22:45 ` [PATCH 08/14] drm/amdgpu/gmc6: switch to using amdgpu_gmc_get_vbios_allocations Alex Deucher
2020-07-28 22:46 ` [PATCH 09/14] drm/amdgpu/gmc7: " Alex Deucher
2020-07-28 22:46 ` [PATCH 10/14] drm/amdgpu/gmc8: " Alex Deucher
2020-07-28 22:46 ` [PATCH 11/14] drm/amdgpu/gmc9: " Alex Deucher
2020-07-28 22:46 ` [PATCH 12/14] drm/amdgpu/gmc10: " Alex Deucher
2020-07-28 22:46 ` [PATCH 13/14] drm/amdgpu: drop the CPU pointers for the stolen vga bos Alex Deucher
2020-07-29  8:46   ` Christian König
2020-07-28 22:46 ` [PATCH 14/14] drm/amdgpu/gmc: disable keep_stolen_vga_memory on arcturus Alex Deucher
2020-07-28 23:28   ` Felix Kuehling

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=021773e5-7d01-7296-2595-6ae9e11e61f8@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /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.