[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of Christian
> König
> Sent: Tuesday, December 2, 2025 8:43 PM
> To: [email protected]; SHANMUGAM, SRINIVASAN
> <[email protected]>; Liu, Leo <[email protected]>; Dong,
> Ruijing <[email protected]>; [email protected]
> Subject: [RFC PATCH 3/3] drm/amdgpu: remove
> AMDGPU_GEM_DOMAIN_DOORBELL

Please change this title to " AMDGPU_GEM_DOMAIN_MMIO_REMAP"

And correspondingly please add fixes tag in commit message for future 
references from where this was derived.

>
> Never activated as UAPI and it turned out that this was to inflexible.
>
> Signed-off-by: Christian König <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    |  3 ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 10 ----------
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.h |  2 --
>  include/uapi/drm/amdgpu_drm.h              |  6 +-----
>  4 files changed, 1 insertion(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 9e9b94dcb699..4fd8121f9d95 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -458,9 +458,6 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void
> *data,
>       /* always clear VRAM */
>       flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
>
> -     if (args->in.domains & AMDGPU_GEM_DOMAIN_MMIO_REMAP)
> -             return -EINVAL;
> -
>       /* create a gem object to contain this object in */
>       if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
>           AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) { diff
> --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index fe51087a54a9..0584c7383c19 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -153,14 +153,6 @@ void amdgpu_bo_placement_from_domain(struct
> amdgpu_bo *abo, u32 domain)
>               c++;
>       }
>
> -     if (domain & AMDGPU_GEM_DOMAIN_MMIO_REMAP) {
> -             places[c].fpfn = 0;
> -             places[c].lpfn = 0;
> -             places[c].mem_type = AMDGPU_PL_MMIO_REMAP;
> -             places[c].flags = 0;
> -             c++;
> -     }
> -
>       if (domain & AMDGPU_GEM_DOMAIN_GTT) {
>               places[c].fpfn = 0;
>               places[c].lpfn = 0;
> @@ -1566,8 +1558,6 @@ uint32_t amdgpu_bo_mem_stats_placement(struct
> amdgpu_bo *bo)
>               return AMDGPU_PL_OA;
>       case AMDGPU_GEM_DOMAIN_DOORBELL:
>               return AMDGPU_PL_DOORBELL;
> -     case AMDGPU_GEM_DOMAIN_MMIO_REMAP:
> -             return AMDGPU_PL_MMIO_REMAP;

Now that the MMIO_REMAP domain bit is gone, nothing maps to 
AMDGPU_PL_MMIO_REMAP anymore.

If we still want a dedicated mmioremap bucket in fdinfo/mem-stats, could we 
instead check bo->resource->mem_type == AMDGPU_PL_MMIO_REMAP here.


Thanks!
Srini


>       default:
>               return TTM_PL_SYSTEM;
>       }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 52c2d1731aab..912c9afaf9e1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -168,8 +168,6 @@ static inline unsigned amdgpu_mem_type_to_domain(u32
> mem_type)
>               return AMDGPU_GEM_DOMAIN_OA;
>       case AMDGPU_PL_DOORBELL:
>               return AMDGPU_GEM_DOMAIN_DOORBELL;
> -     case AMDGPU_PL_MMIO_REMAP:
> -             return AMDGPU_GEM_DOMAIN_MMIO_REMAP;
>       default:
>               break;
>       }
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h 
> index
> 6927c864a6d1..0d743fe92146 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -105,8 +105,6 @@ extern "C" {
>   *
>   * %AMDGPU_GEM_DOMAIN_DOORBELL       Doorbell. It is an MMIO region
> for
>   * signalling user mode queues.
> - *
> - * %AMDGPU_GEM_DOMAIN_MMIO_REMAP     MMIO remap page (special
> mapping for HDP flushing).
>   */
>  #define AMDGPU_GEM_DOMAIN_CPU                0x1
>  #define AMDGPU_GEM_DOMAIN_GTT                0x2
> @@ -115,15 +113,13 @@ extern "C" {
>  #define AMDGPU_GEM_DOMAIN_GWS                0x10
>  #define AMDGPU_GEM_DOMAIN_OA         0x20
>  #define AMDGPU_GEM_DOMAIN_DOORBELL   0x40
> -#define AMDGPU_GEM_DOMAIN_MMIO_REMAP 0x80
>  #define AMDGPU_GEM_DOMAIN_MASK
>       (AMDGPU_GEM_DOMAIN_CPU | \
>                                        AMDGPU_GEM_DOMAIN_GTT | \
>                                        AMDGPU_GEM_DOMAIN_VRAM | \
>                                        AMDGPU_GEM_DOMAIN_GDS | \
>                                        AMDGPU_GEM_DOMAIN_GWS | \
>                                        AMDGPU_GEM_DOMAIN_OA | \
> -                                      AMDGPU_GEM_DOMAIN_DOORBELL | \
> -                                      AMDGPU_GEM_DOMAIN_MMIO_REMAP)
> +                                      AMDGPU_GEM_DOMAIN_DOORBELL)
>
>  /* Flag that CPU access will be required for the case of VRAM domain */
>  #define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED        (1 << 0)
> --
> 2.43.0

Reply via email to