]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drm/amdgpu/pm: document pp_od_clk_voltage
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_gem.c
index 1200c5ba37dad1ab369d542f06479bc1ad0e7ce4..7d3dc229fa47d43b469ac87cb31427e4f6d50079 100644 (file)
@@ -62,6 +62,7 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
        bp.byte_align = alignment;
        bp.type = type;
        bp.resv = resv;
+       bp.preferred_domain = initial_domain;
 retry:
        bp.flags = flags;
        bp.domain = initial_domain;
@@ -228,12 +229,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
                return -EINVAL;
 
        /* reject invalid gem domains */
-       if (args->in.domains & ~(AMDGPU_GEM_DOMAIN_CPU |
-                                AMDGPU_GEM_DOMAIN_GTT |
-                                AMDGPU_GEM_DOMAIN_VRAM |
-                                AMDGPU_GEM_DOMAIN_GDS |
-                                AMDGPU_GEM_DOMAIN_GWS |
-                                AMDGPU_GEM_DOMAIN_OA))
+       if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
                return -EINVAL;
 
        /* create a gem object to contain this object in */
@@ -784,6 +780,8 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
        struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
        struct seq_file *m = data;
 
+       struct dma_buf_attachment *attachment;
+       struct dma_buf *dma_buf;
        unsigned domain;
        const char *placement;
        unsigned pin_count;
@@ -812,6 +810,15 @@ static int amdgpu_debugfs_gem_bo_info(int id, void *ptr, void *data)
        pin_count = READ_ONCE(bo->pin_count);
        if (pin_count)
                seq_printf(m, " pin count %d", pin_count);
+
+       dma_buf = READ_ONCE(bo->gem_base.dma_buf);
+       attachment = READ_ONCE(bo->gem_base.import_attach);
+
+       if (attachment)
+               seq_printf(m, " imported from %p", dma_buf);
+       else if (dma_buf)
+               seq_printf(m, " exported as %p", dma_buf);
+
        seq_printf(m, "\n");
 
        return 0;
This page took 0.036401 seconds and 4 git commands to generate.