Commit 7053e0ea authored by Christian König's avatar Christian König

drm/vram-helper: stop using TTM placement flags

Those are going to be removed, stop using them here.

Instead define separate flags for the helper.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/389823/?series=81551&rev=1
parent 44943463
...@@ -135,20 +135,23 @@ static void ttm_buffer_object_destroy(struct ttm_buffer_object *bo) ...@@ -135,20 +135,23 @@ static void ttm_buffer_object_destroy(struct ttm_buffer_object *bo)
static void drm_gem_vram_placement(struct drm_gem_vram_object *gbo, static void drm_gem_vram_placement(struct drm_gem_vram_object *gbo,
unsigned long pl_flag) unsigned long pl_flag)
{ {
u32 invariant_flags = 0;
unsigned int i; unsigned int i;
unsigned int c = 0; unsigned int c = 0;
u32 invariant_flags = pl_flag & TTM_PL_FLAG_TOPDOWN;
if (pl_flag & DRM_GEM_VRAM_PL_FLAG_TOPDOWN)
pl_flag = TTM_PL_FLAG_TOPDOWN;
gbo->placement.placement = gbo->placements; gbo->placement.placement = gbo->placements;
gbo->placement.busy_placement = gbo->placements; gbo->placement.busy_placement = gbo->placements;
if (pl_flag & TTM_PL_FLAG_VRAM) if (pl_flag & DRM_GEM_VRAM_PL_FLAG_VRAM)
gbo->placements[c++].flags = TTM_PL_FLAG_WC | gbo->placements[c++].flags = TTM_PL_FLAG_WC |
TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_UNCACHED |
TTM_PL_FLAG_VRAM | TTM_PL_FLAG_VRAM |
invariant_flags; invariant_flags;
if (pl_flag & TTM_PL_FLAG_SYSTEM) if (pl_flag & DRM_GEM_VRAM_PL_FLAG_SYSTEM)
gbo->placements[c++].flags = TTM_PL_MASK_CACHING | gbo->placements[c++].flags = TTM_PL_MASK_CACHING |
TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_SYSTEM |
invariant_flags; invariant_flags;
...@@ -189,7 +192,8 @@ static int drm_gem_vram_init(struct drm_device *dev, ...@@ -189,7 +192,8 @@ static int drm_gem_vram_init(struct drm_device *dev,
acc_size = ttm_bo_dma_acc_size(bdev, size, sizeof(*gbo)); acc_size = ttm_bo_dma_acc_size(bdev, size, sizeof(*gbo));
gbo->bo.bdev = bdev; gbo->bo.bdev = bdev;
drm_gem_vram_placement(gbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM); drm_gem_vram_placement(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM |
DRM_GEM_VRAM_PL_FLAG_SYSTEM);
ret = ttm_bo_init(bdev, &gbo->bo, size, ttm_bo_type_device, ret = ttm_bo_init(bdev, &gbo->bo, size, ttm_bo_type_device,
&gbo->placement, pg_align, false, acc_size, &gbo->placement, pg_align, false, acc_size,
...@@ -647,7 +651,7 @@ static bool drm_is_gem_vram(struct ttm_buffer_object *bo) ...@@ -647,7 +651,7 @@ static bool drm_is_gem_vram(struct ttm_buffer_object *bo)
static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo, static void drm_gem_vram_bo_driver_evict_flags(struct drm_gem_vram_object *gbo,
struct ttm_placement *pl) struct ttm_placement *pl)
{ {
drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM); drm_gem_vram_placement(gbo, DRM_GEM_VRAM_PL_FLAG_SYSTEM);
*pl = gbo->placement; *pl = gbo->placement;
} }
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <drm/drm_modes.h> #include <drm/drm_modes.h>
#include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h> #include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <linux/kernel.h> /* for container_of() */ #include <linux/kernel.h> /* for container_of() */
...@@ -20,9 +19,9 @@ struct drm_simple_display_pipe; ...@@ -20,9 +19,9 @@ struct drm_simple_display_pipe;
struct filp; struct filp;
struct vm_area_struct; struct vm_area_struct;
#define DRM_GEM_VRAM_PL_FLAG_VRAM TTM_PL_FLAG_VRAM #define DRM_GEM_VRAM_PL_FLAG_SYSTEM (1 << 0)
#define DRM_GEM_VRAM_PL_FLAG_SYSTEM TTM_PL_FLAG_SYSTEM #define DRM_GEM_VRAM_PL_FLAG_VRAM (1 << 1)
#define DRM_GEM_VRAM_PL_FLAG_TOPDOWN TTM_PL_FLAG_TOPDOWN #define DRM_GEM_VRAM_PL_FLAG_TOPDOWN (1 << 2)
/* /*
* Buffer-object helpers * Buffer-object helpers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment