* [PATCH 1/4] drm/ttm: use ffs in ttm_mem_type_from_place @ 2016-09-12 11:46 Christian König 2016-09-12 11:46 ` [PATCH 2/4] drm/ttm: rework handling of private mem types Christian König ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Christian König @ 2016-09-12 11:46 UTC (permalink / raw) To: dri-devel; +Cc: Alexander.Deucher, flora.cui, emil.l.velikov, Hawking.Zhang From: Christian König <christian.koenig@amd.com> A bit pointless to search for the first bit set manually. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index bc37f02..531cc97 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -57,14 +57,14 @@ static struct attribute ttm_bo_count = { static inline int ttm_mem_type_from_place(const struct ttm_place *place, uint32_t *mem_type) { - int i; + int pos; - for (i = 0; i <= TTM_PL_PRIV5; i++) - if (place->flags & (1 << i)) { - *mem_type = i; - return 0; - } - return -EINVAL; + pos = ffs(place->flags & TTM_PL_MASK_MEM); + if (unlikely(!pos)) + return -EINVAL; + + *mem_type = pos - 1; + return 0; } static void ttm_mem_type_debug(struct ttm_bo_device *bdev, int mem_type) -- 2.5.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] drm/ttm: rework handling of private mem types 2016-09-12 11:46 [PATCH 1/4] drm/ttm: use ffs in ttm_mem_type_from_place Christian König @ 2016-09-12 11:46 ` Christian König 2016-09-12 11:46 ` [PATCH 3/4] drm/ttm: remove unused placement flags Christian König 2016-09-12 11:46 ` [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h Christian König 2 siblings, 0 replies; 6+ messages in thread From: Christian König @ 2016-09-12 11:46 UTC (permalink / raw) To: dri-devel; +Cc: Alexander.Deucher, flora.cui, emil.l.velikov, Hawking.Zhang From: Christian König <christian.koenig@amd.com> Instead of keeping a bunch of potentially unused flags, just define the start for private memory types and remove the rest. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 12 ++++++------ drivers/gpu/drm/qxl/qxl_object.c | 8 ++++---- drivers/gpu/drm/qxl/qxl_ttm.c | 12 ++++++------ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 8 ++++---- include/drm/ttm/ttm_placement.h | 16 ++-------------- 5 files changed, 22 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h index 214bae9..3ee825f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h @@ -26,13 +26,13 @@ #include "gpu_scheduler.h" -#define AMDGPU_PL_GDS TTM_PL_PRIV0 -#define AMDGPU_PL_GWS TTM_PL_PRIV1 -#define AMDGPU_PL_OA TTM_PL_PRIV2 +#define AMDGPU_PL_GDS (TTM_PL_PRIV + 0) +#define AMDGPU_PL_GWS (TTM_PL_PRIV + 1) +#define AMDGPU_PL_OA (TTM_PL_PRIV + 2) -#define AMDGPU_PL_FLAG_GDS TTM_PL_FLAG_PRIV0 -#define AMDGPU_PL_FLAG_GWS TTM_PL_FLAG_PRIV1 -#define AMDGPU_PL_FLAG_OA TTM_PL_FLAG_PRIV2 +#define AMDGPU_PL_FLAG_GDS (TTM_PL_FLAG_PRIV << 0) +#define AMDGPU_PL_FLAG_GWS (TTM_PL_FLAG_PRIV << 1) +#define AMDGPU_PL_FLAG_OA (TTM_PL_FLAG_PRIV << 2) #define AMDGPU_TTM_LRU_SIZE 20 diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 5e1d789..fa5440d 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -61,7 +61,7 @@ void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned) if (domain == QXL_GEM_DOMAIN_VRAM) qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_VRAM | pflag; if (domain == QXL_GEM_DOMAIN_SURFACE) - qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_PRIV0 | pflag; + qbo->placements[c++].flags = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_PRIV | pflag; if (domain == QXL_GEM_DOMAIN_CPU) qbo->placements[c++].flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM | pflag; if (!c) @@ -151,7 +151,7 @@ void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, if (bo->tbo.mem.mem_type == TTM_PL_VRAM) map = qdev->vram_mapping; - else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0) + else if (bo->tbo.mem.mem_type == TTM_PL_PRIV) map = qdev->surface_mapping; else goto fallback; @@ -191,7 +191,7 @@ void qxl_bo_kunmap_atomic_page(struct qxl_device *qdev, if (bo->tbo.mem.mem_type == TTM_PL_VRAM) map = qdev->vram_mapping; - else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0) + else if (bo->tbo.mem.mem_type == TTM_PL_PRIV) map = qdev->surface_mapping; else goto fallback; @@ -311,7 +311,7 @@ int qxl_bo_check_id(struct qxl_device *qdev, struct qxl_bo *bo) int qxl_surf_evict(struct qxl_device *qdev) { - return ttm_bo_evict_mm(&qdev->mman.bdev, TTM_PL_PRIV0); + return ttm_bo_evict_mm(&qdev->mman.bdev, TTM_PL_PRIV); } int qxl_vram_evict(struct qxl_device *qdev) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index d50c967..796c4f3 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -168,7 +168,7 @@ static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->default_caching = TTM_PL_FLAG_CACHED; break; case TTM_PL_VRAM: - case TTM_PL_PRIV0: + case TTM_PL_PRIV: /* "On-card" video ram */ man->func = &ttm_bo_manager_func; man->gpu_offset = 0; @@ -235,7 +235,7 @@ static int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev, mem->bus.base = qdev->vram_base; mem->bus.offset = mem->start << PAGE_SHIFT; break; - case TTM_PL_PRIV0: + case TTM_PL_PRIV: mem->bus.is_iomem = true; mem->bus.base = qdev->surfaceram_base; mem->bus.offset = mem->start << PAGE_SHIFT; @@ -376,7 +376,7 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo, qbo = to_qxl_bo(bo); qdev = qbo->gem_base.dev->dev_private; - if (bo->mem.mem_type == TTM_PL_PRIV0 && qbo->surface_id) + if (bo->mem.mem_type == TTM_PL_PRIV && qbo->surface_id) qxl_surface_evict(qdev, qbo, new_mem ? true : false); } @@ -422,7 +422,7 @@ int qxl_ttm_init(struct qxl_device *qdev) DRM_ERROR("Failed initializing VRAM heap.\n"); return r; } - r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_PRIV0, + r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_PRIV, qdev->surfaceram_size / PAGE_SIZE); if (r) { DRM_ERROR("Failed initializing Surfaces heap.\n"); @@ -445,7 +445,7 @@ int qxl_ttm_init(struct qxl_device *qdev) void qxl_ttm_fini(struct qxl_device *qdev) { ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_VRAM); - ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_PRIV0); + ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_PRIV); ttm_bo_device_release(&qdev->mman.bdev); qxl_ttm_global_fini(qdev); DRM_INFO("qxl: ttm finalized\n"); @@ -489,7 +489,7 @@ static int qxl_ttm_debugfs_init(struct qxl_device *qdev) if (i == 0) qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv; else - qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv; + qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV].priv; } return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 019a6ca..b5de8a1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -66,10 +66,10 @@ VMWGFX_NUM_GB_SURFACE +\ VMWGFX_NUM_GB_SCREEN_TARGET) -#define VMW_PL_GMR TTM_PL_PRIV0 -#define VMW_PL_FLAG_GMR TTM_PL_FLAG_PRIV0 -#define VMW_PL_MOB TTM_PL_PRIV1 -#define VMW_PL_FLAG_MOB TTM_PL_FLAG_PRIV1 +#define VMW_PL_GMR (TTM_PL_PRIV + 0) +#define VMW_PL_FLAG_GMR (TTM_PL_FLAG_PRIV << 0) +#define VMW_PL_MOB (TTM_PL_PRIV + 1) +#define VMW_PL_FLAG_MOB (TTM_PL_FLAG_PRIV << 1) #define VMW_RES_CONTEXT ttm_driver_type0 #define VMW_RES_SURFACE ttm_driver_type1 diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h index 8ed44f9..4c579d9 100644 --- a/include/drm/ttm/ttm_placement.h +++ b/include/drm/ttm/ttm_placement.h @@ -37,24 +37,12 @@ #define TTM_PL_SYSTEM 0 #define TTM_PL_TT 1 #define TTM_PL_VRAM 2 -#define TTM_PL_PRIV0 3 -#define TTM_PL_PRIV1 4 -#define TTM_PL_PRIV2 5 -#define TTM_PL_PRIV3 6 -#define TTM_PL_PRIV4 7 -#define TTM_PL_PRIV5 8 -#define TTM_PL_SWAPPED 15 +#define TTM_PL_PRIV 3 #define TTM_PL_FLAG_SYSTEM (1 << TTM_PL_SYSTEM) #define TTM_PL_FLAG_TT (1 << TTM_PL_TT) #define TTM_PL_FLAG_VRAM (1 << TTM_PL_VRAM) -#define TTM_PL_FLAG_PRIV0 (1 << TTM_PL_PRIV0) -#define TTM_PL_FLAG_PRIV1 (1 << TTM_PL_PRIV1) -#define TTM_PL_FLAG_PRIV2 (1 << TTM_PL_PRIV2) -#define TTM_PL_FLAG_PRIV3 (1 << TTM_PL_PRIV3) -#define TTM_PL_FLAG_PRIV4 (1 << TTM_PL_PRIV4) -#define TTM_PL_FLAG_PRIV5 (1 << TTM_PL_PRIV5) -#define TTM_PL_FLAG_SWAPPED (1 << TTM_PL_SWAPPED) +#define TTM_PL_FLAG_PRIV (1 << TTM_PL_PRIV) #define TTM_PL_MASK_MEM 0x0000FFFF /* -- 2.5.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] drm/ttm: remove unused placement flags 2016-09-12 11:46 [PATCH 1/4] drm/ttm: use ffs in ttm_mem_type_from_place Christian König 2016-09-12 11:46 ` [PATCH 2/4] drm/ttm: rework handling of private mem types Christian König @ 2016-09-12 11:46 ` Christian König 2016-09-12 11:46 ` [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h Christian König 2 siblings, 0 replies; 6+ messages in thread From: Christian König @ 2016-09-12 11:46 UTC (permalink / raw) To: dri-devel; +Cc: Alexander.Deucher, flora.cui, emil.l.velikov, Hawking.Zhang From: Christian König <christian.koenig@amd.com> Either never used or not used in quite a while. Signed-off-by: Christian König <christian.koenig@amd.com> --- include/drm/ttm/ttm_placement.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h index 4c579d9..7641582 100644 --- a/include/drm/ttm/ttm_placement.h +++ b/include/drm/ttm/ttm_placement.h @@ -60,7 +60,6 @@ #define TTM_PL_FLAG_CACHED (1 << 16) #define TTM_PL_FLAG_UNCACHED (1 << 17) #define TTM_PL_FLAG_WC (1 << 18) -#define TTM_PL_FLAG_SHARED (1 << 20) #define TTM_PL_FLAG_NO_EVICT (1 << 21) #define TTM_PL_FLAG_TOPDOWN (1 << 22) @@ -70,14 +69,4 @@ #define TTM_PL_MASK_MEMTYPE (TTM_PL_MASK_MEM | TTM_PL_MASK_CACHING) -/* - * Access flags to be used for CPU- and GPU- mappings. - * The idea is that the TTM synchronization mechanism will - * allow concurrent READ access and exclusive write access. - * Currently GPU- and CPU accesses are exclusive. - */ - -#define TTM_ACCESS_READ (1 << 0) -#define TTM_ACCESS_WRITE (1 << 1) - #endif -- 2.5.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h 2016-09-12 11:46 [PATCH 1/4] drm/ttm: use ffs in ttm_mem_type_from_place Christian König 2016-09-12 11:46 ` [PATCH 2/4] drm/ttm: rework handling of private mem types Christian König 2016-09-12 11:46 ` [PATCH 3/4] drm/ttm: remove unused placement flags Christian König @ 2016-09-12 11:46 ` Christian König 2016-09-12 21:00 ` Alex Deucher 2 siblings, 1 reply; 6+ messages in thread From: Christian König @ 2016-09-12 11:46 UTC (permalink / raw) To: dri-devel; +Cc: Alexander.Deucher, flora.cui, emil.l.velikov, Hawking.Zhang From: Christian König <christian.koenig@amd.com> Makes more sense to keep that together. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> --- include/drm/ttm/ttm_bo_api.h | 32 +------------------------------- include/drm/ttm/ttm_placement.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 97aaf5c..d73c7c2 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -45,37 +45,7 @@ struct ttm_bo_device; struct drm_mm_node; -/** - * struct ttm_place - * - * @fpfn: first valid page frame number to put the object - * @lpfn: last valid page frame number to put the object - * @flags: memory domain and caching flags for the object - * - * Structure indicating a possible place to put an object. - */ -struct ttm_place { - unsigned fpfn; - unsigned lpfn; - uint32_t flags; -}; - -/** - * struct ttm_placement - * - * @num_placement: number of preferred placements - * @placement: preferred placements - * @num_busy_placement: number of preferred placements when need to evict buffer - * @busy_placement: preferred placements when need to evict buffer - * - * Structure indicating the placement you request for an object. - */ -struct ttm_placement { - unsigned num_placement; - const struct ttm_place *placement; - unsigned num_busy_placement; - const struct ttm_place *busy_placement; -}; +struct ttm_placement; /** * struct ttm_bus_placement diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h index 7641582..932be0c 100644 --- a/include/drm/ttm/ttm_placement.h +++ b/include/drm/ttm/ttm_placement.h @@ -30,6 +30,9 @@ #ifndef _TTM_PLACEMENT_H_ #define _TTM_PLACEMENT_H_ + +#include <linux/types.h> + /* * Memory regions for data placement. */ @@ -69,4 +72,36 @@ #define TTM_PL_MASK_MEMTYPE (TTM_PL_MASK_MEM | TTM_PL_MASK_CACHING) +/** + * struct ttm_place + * + * @fpfn: first valid page frame number to put the object + * @lpfn: last valid page frame number to put the object + * @flags: memory domain and caching flags for the object + * + * Structure indicating a possible place to put an object. + */ +struct ttm_place { + unsigned fpfn; + unsigned lpfn; + uint32_t flags; +}; + +/** + * struct ttm_placement + * + * @num_placement: number of preferred placements + * @placement: preferred placements + * @num_busy_placement: number of preferred placements when need to evict buffer + * @busy_placement: preferred placements when need to evict buffer + * + * Structure indicating the placement you request for an object. + */ +struct ttm_placement { + unsigned num_placement; + const struct ttm_place *placement; + unsigned num_busy_placement; + const struct ttm_place *busy_placement; +}; + #endif -- 2.5.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h 2016-09-12 11:46 ` [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h Christian König @ 2016-09-12 21:00 ` Alex Deucher 2016-09-13 1:57 ` zhoucm1 0 siblings, 1 reply; 6+ messages in thread From: Alex Deucher @ 2016-09-12 21:00 UTC (permalink / raw) To: Christian König Cc: Deucher, Alexander, Flora Cui, Emil Velikov, Maling list - DRI developers, Hawking Zhang On Mon, Sep 12, 2016 at 7:46 AM, Christian König <deathsimple@vodafone.de> wrote: > From: Christian König <christian.koenig@amd.com> > > Makes more sense to keep that together. > > Signed-off-by: Christian König <christian.koenig@amd.com> > Reviewed-by: Chunming Zhou <david1.zhou@amd.com> For the series: Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > --- > include/drm/ttm/ttm_bo_api.h | 32 +------------------------------- > include/drm/ttm/ttm_placement.h | 35 +++++++++++++++++++++++++++++++++++ > 2 files changed, 36 insertions(+), 31 deletions(-) > > diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h > index 97aaf5c..d73c7c2 100644 > --- a/include/drm/ttm/ttm_bo_api.h > +++ b/include/drm/ttm/ttm_bo_api.h > @@ -45,37 +45,7 @@ struct ttm_bo_device; > > struct drm_mm_node; > > -/** > - * struct ttm_place > - * > - * @fpfn: first valid page frame number to put the object > - * @lpfn: last valid page frame number to put the object > - * @flags: memory domain and caching flags for the object > - * > - * Structure indicating a possible place to put an object. > - */ > -struct ttm_place { > - unsigned fpfn; > - unsigned lpfn; > - uint32_t flags; > -}; > - > -/** > - * struct ttm_placement > - * > - * @num_placement: number of preferred placements > - * @placement: preferred placements > - * @num_busy_placement: number of preferred placements when need to evict buffer > - * @busy_placement: preferred placements when need to evict buffer > - * > - * Structure indicating the placement you request for an object. > - */ > -struct ttm_placement { > - unsigned num_placement; > - const struct ttm_place *placement; > - unsigned num_busy_placement; > - const struct ttm_place *busy_placement; > -}; > +struct ttm_placement; > > /** > * struct ttm_bus_placement > diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h > index 7641582..932be0c 100644 > --- a/include/drm/ttm/ttm_placement.h > +++ b/include/drm/ttm/ttm_placement.h > @@ -30,6 +30,9 @@ > > #ifndef _TTM_PLACEMENT_H_ > #define _TTM_PLACEMENT_H_ > + > +#include <linux/types.h> > + > /* > * Memory regions for data placement. > */ > @@ -69,4 +72,36 @@ > > #define TTM_PL_MASK_MEMTYPE (TTM_PL_MASK_MEM | TTM_PL_MASK_CACHING) > > +/** > + * struct ttm_place > + * > + * @fpfn: first valid page frame number to put the object > + * @lpfn: last valid page frame number to put the object > + * @flags: memory domain and caching flags for the object > + * > + * Structure indicating a possible place to put an object. > + */ > +struct ttm_place { > + unsigned fpfn; > + unsigned lpfn; > + uint32_t flags; > +}; > + > +/** > + * struct ttm_placement > + * > + * @num_placement: number of preferred placements > + * @placement: preferred placements > + * @num_busy_placement: number of preferred placements when need to evict buffer > + * @busy_placement: preferred placements when need to evict buffer > + * > + * Structure indicating the placement you request for an object. > + */ > +struct ttm_placement { > + unsigned num_placement; > + const struct ttm_place *placement; > + unsigned num_busy_placement; > + const struct ttm_place *busy_placement; > +}; > + > #endif > -- > 2.5.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h 2016-09-12 21:00 ` Alex Deucher @ 2016-09-13 1:57 ` zhoucm1 0 siblings, 0 replies; 6+ messages in thread From: zhoucm1 @ 2016-09-13 1:57 UTC (permalink / raw) To: Alex Deucher, Christian König Cc: Deucher, Alexander, Flora Cui, Emil Velikov, Maling list - DRI developers, Hawking Zhang On 2016年09月13日 05:00, Alex Deucher wrote: > On Mon, Sep 12, 2016 at 7:46 AM, Christian König > <deathsimple@vodafone.de> wrote: >> From: Christian König <christian.koenig@amd.com> >> >> Makes more sense to keep that together. >> >> Signed-off-by: Christian König <christian.koenig@amd.com> >> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> > For the series: > Reviewed-by: Alex Deucher <alexander.deucher@amd.com> The series is ok to me. Regards, David Zhou > >> --- >> include/drm/ttm/ttm_bo_api.h | 32 +------------------------------- >> include/drm/ttm/ttm_placement.h | 35 +++++++++++++++++++++++++++++++++++ >> 2 files changed, 36 insertions(+), 31 deletions(-) >> >> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h >> index 97aaf5c..d73c7c2 100644 >> --- a/include/drm/ttm/ttm_bo_api.h >> +++ b/include/drm/ttm/ttm_bo_api.h >> @@ -45,37 +45,7 @@ struct ttm_bo_device; >> >> struct drm_mm_node; >> >> -/** >> - * struct ttm_place >> - * >> - * @fpfn: first valid page frame number to put the object >> - * @lpfn: last valid page frame number to put the object >> - * @flags: memory domain and caching flags for the object >> - * >> - * Structure indicating a possible place to put an object. >> - */ >> -struct ttm_place { >> - unsigned fpfn; >> - unsigned lpfn; >> - uint32_t flags; >> -}; >> - >> -/** >> - * struct ttm_placement >> - * >> - * @num_placement: number of preferred placements >> - * @placement: preferred placements >> - * @num_busy_placement: number of preferred placements when need to evict buffer >> - * @busy_placement: preferred placements when need to evict buffer >> - * >> - * Structure indicating the placement you request for an object. >> - */ >> -struct ttm_placement { >> - unsigned num_placement; >> - const struct ttm_place *placement; >> - unsigned num_busy_placement; >> - const struct ttm_place *busy_placement; >> -}; >> +struct ttm_placement; >> >> /** >> * struct ttm_bus_placement >> diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h >> index 7641582..932be0c 100644 >> --- a/include/drm/ttm/ttm_placement.h >> +++ b/include/drm/ttm/ttm_placement.h >> @@ -30,6 +30,9 @@ >> >> #ifndef _TTM_PLACEMENT_H_ >> #define _TTM_PLACEMENT_H_ >> + >> +#include <linux/types.h> >> + >> /* >> * Memory regions for data placement. >> */ >> @@ -69,4 +72,36 @@ >> >> #define TTM_PL_MASK_MEMTYPE (TTM_PL_MASK_MEM | TTM_PL_MASK_CACHING) >> >> +/** >> + * struct ttm_place >> + * >> + * @fpfn: first valid page frame number to put the object >> + * @lpfn: last valid page frame number to put the object >> + * @flags: memory domain and caching flags for the object >> + * >> + * Structure indicating a possible place to put an object. >> + */ >> +struct ttm_place { >> + unsigned fpfn; >> + unsigned lpfn; >> + uint32_t flags; >> +}; >> + >> +/** >> + * struct ttm_placement >> + * >> + * @num_placement: number of preferred placements >> + * @placement: preferred placements >> + * @num_busy_placement: number of preferred placements when need to evict buffer >> + * @busy_placement: preferred placements when need to evict buffer >> + * >> + * Structure indicating the placement you request for an object. >> + */ >> +struct ttm_placement { >> + unsigned num_placement; >> + const struct ttm_place *placement; >> + unsigned num_busy_placement; >> + const struct ttm_place *busy_placement; >> +}; >> + >> #endif >> -- >> 2.5.0 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-09-13 2:31 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-09-12 11:46 [PATCH 1/4] drm/ttm: use ffs in ttm_mem_type_from_place Christian König 2016-09-12 11:46 ` [PATCH 2/4] drm/ttm: rework handling of private mem types Christian König 2016-09-12 11:46 ` [PATCH 3/4] drm/ttm: remove unused placement flags Christian König 2016-09-12 11:46 ` [PATCH 4/4] drm/ttm: move placement structures into ttm_placement.h Christian König 2016-09-12 21:00 ` Alex Deucher 2016-09-13 1:57 ` zhoucm1
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.