]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
Merge tag 'drm-misc-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-misc...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_vram_mgr.c
index d2de2a720a3d86fcdca9feaed5d562fc8141238e..b2fc475ce6f705e5d044fed6f2e5916ef77992cf 100644 (file)
@@ -473,6 +473,9 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
        for (i = 0; pages_left >= pages_per_node; ++i) {
                unsigned long pages = rounddown_pow_of_two(pages_left);
 
+               /* Limit maximum size to 2GB due to SG table limitations */
+               pages = min(pages, (2UL << (30 - PAGE_SHIFT)));
+
                r = drm_mm_insert_node_in_range(mm, &nodes[i], pages,
                                                pages_per_node, 0,
                                                place->fpfn, lpfn,
@@ -636,15 +639,13 @@ error_free:
 /**
  * amdgpu_vram_mgr_free_sgt - allocate and fill a sg table
  *
- * @adev: amdgpu device pointer
  * @dev: device pointer
  * @dir: data direction of resource to unmap
  * @sgt: sg table to free
  *
  * Free a previously allocate sg table.
  */
-void amdgpu_vram_mgr_free_sgt(struct amdgpu_device *adev,
-                             struct device *dev,
+void amdgpu_vram_mgr_free_sgt(struct device *dev,
                              enum dma_data_direction dir,
                              struct sg_table *sgt)
 {
This page took 0.034737 seconds and 4 git commands to generate.