]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge tag 'drm-misc-next-2019-10-24-2' of git://anongit.freedesktop.org/drm/drm-misc...
authorDave Airlie <airlied@redhat.com>
Tue, 29 Oct 2019 20:10:59 +0000 (06:10 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 29 Oct 2019 20:11:47 +0000 (06:11 +1000)
drm-misc-next for 5.5:

UAPI Changes:
-syncobj: allow querying the last submitted timeline value (David)
-fourcc: explicitly defineDRM_FORMAT_BIG_ENDIAN as unsigned (Adam)
-omap: revert the OMAP_BO_* flags that were added -- no userspace (Sean)

Cross-subsystem Changes:
-MAINTAINERS: add Mihail as komeda co-maintainer (Mihail)

Core Changes:
-edid: a few cleanups, add AVI infoframe bar info (Ville)
-todo: remove i915 device_link item and add difficulty levels (Daniel)
-dp_helpers: add a few new helpers to parse dpcd (Thierry)

Driver Changes:
-gma500: fix a few memory disclosure leaks (Kangjie)
-qxl: convert to use the new drm_gem_object_funcs.mmap (Gerd)
-various: open code dp_link helpers in preparation for helper removal (Thierry)

Cc: Chunming Zhou <david1.zhou@amd.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Mihail Atanassov <mihail.atanassov@arm.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20191024155535.GA10294@art_vandelay
1  2 
drivers/gpu/drm/Kconfig
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

diff --combined drivers/gpu/drm/Kconfig
index 852a594696883bcafdfc68669e78fcd30ea7c946,36357a36a28107bd62057e60b16508eaf58bd2be..dba57ca0c9d94c89748f706755b845eb50926997
@@@ -232,9 -232,9 +232,9 @@@ config DRM_AMDGP
        tristate "AMD GPU"
        depends on DRM && PCI && MMU
        select FW_LOADER
 -        select DRM_KMS_HELPER
 +      select DRM_KMS_HELPER
        select DRM_SCHED
 -        select DRM_TTM
 +      select DRM_TTM
        select POWER_SUPPLY
        select HWMON
        select BACKLIGHT_CLASS_DEVICE
@@@ -263,6 -263,7 +263,7 @@@ config DRM_VKM
        tristate "Virtual KMS (EXPERIMENTAL)"
        depends on DRM
        select DRM_KMS_HELPER
+       select CRC32
        default n
        help
          Virtual Kernel Mode-Setting (VKMS) is used for testing or for
@@@ -403,7 -404,7 +404,7 @@@ config DRM_R12
  
  config DRM_I810
        tristate "Intel I810"
-       # !PREEMPT because of missing ioctl locking
+       # !PREEMPTION because of missing ioctl locking
        depends on DRM && AGP && AGP_INTEL && (!PREEMPTION || BROKEN)
        help
          Choose this option if you have an Intel I810 graphics card.  If M is
index b8e5076e5e30d4466626d465855a23507334d398,6f0b789a0b49a9d07e526cf74ebdd058d86bc87e..e3f16b49e970826023c52e8fa474d27414d0c5e7
@@@ -342,70 -342,6 +342,70 @@@ int amdgpu_bo_create_kernel(struct amdg
        return 0;
  }
  
 +/**
 + * amdgpu_bo_create_kernel_at - create BO for kernel use at specific location
 + *
 + * @adev: amdgpu device object
 + * @offset: offset of the BO
 + * @size: size of the BO
 + * @domain: where to place it
 + * @bo_ptr:  used to initialize BOs in structures
 + * @cpu_addr: optional CPU address mapping
 + *
 + * Creates a kernel BO at a specific offset in the address space of the domain.
 + *
 + * Returns:
 + * 0 on success, negative error code otherwise.
 + */
 +int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev,
 +                             uint64_t offset, uint64_t size, uint32_t domain,
 +                             struct amdgpu_bo **bo_ptr, void **cpu_addr)
 +{
 +      struct ttm_operation_ctx ctx = { false, false };
 +      unsigned int i;
 +      int r;
 +
 +      offset &= PAGE_MASK;
 +      size = ALIGN(size, PAGE_SIZE);
 +
 +      r = amdgpu_bo_create_reserved(adev, size, PAGE_SIZE, domain, bo_ptr,
 +                                    NULL, cpu_addr);
 +      if (r)
 +              return r;
 +
 +      /*
 +       * Remove the original mem node and create a new one at the request
 +       * position.
 +       */
 +      if (cpu_addr)
 +              amdgpu_bo_kunmap(*bo_ptr);
 +
 +      ttm_bo_mem_put(&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem);
 +
 +      for (i = 0; i < (*bo_ptr)->placement.num_placement; ++i) {
 +              (*bo_ptr)->placements[i].fpfn = offset >> PAGE_SHIFT;
 +              (*bo_ptr)->placements[i].lpfn = (offset + size) >> PAGE_SHIFT;
 +      }
 +      r = ttm_bo_mem_space(&(*bo_ptr)->tbo, &(*bo_ptr)->placement,
 +                           &(*bo_ptr)->tbo.mem, &ctx);
 +      if (r)
 +              goto error;
 +
 +      if (cpu_addr) {
 +              r = amdgpu_bo_kmap(*bo_ptr, cpu_addr);
 +              if (r)
 +                      goto error;
 +      }
 +
 +      amdgpu_bo_unreserve(*bo_ptr);
 +      return 0;
 +
 +error:
 +      amdgpu_bo_unreserve(*bo_ptr);
 +      amdgpu_bo_unref(bo_ptr);
 +      return r;
 +}
 +
  /**
   * amdgpu_bo_free_kernel - free BO for kernel use
   *
@@@ -515,10 -451,9 +515,10 @@@ static int amdgpu_bo_do_create(struct a
  {
        struct ttm_operation_ctx ctx = {
                .interruptible = (bp->type != ttm_bo_type_kernel),
 -              .no_wait_gpu = false,
 +              .no_wait_gpu = bp->no_wait_gpu,
                .resv = bp->resv,
 -              .flags = TTM_OPT_FLAG_ALLOW_RES_EVICT
 +              .flags = bp->type != ttm_bo_type_kernel ?
 +                      TTM_OPT_FLAG_ALLOW_RES_EVICT : 0
        };
        struct amdgpu_bo *bo;
        unsigned long page_align, size = bp->size;
@@@ -1123,7 -1058,10 +1123,10 @@@ void amdgpu_bo_fini(struct amdgpu_devic
  int amdgpu_bo_fbdev_mmap(struct amdgpu_bo *bo,
                             struct vm_area_struct *vma)
  {
-       return ttm_fbdev_mmap(vma, &bo->tbo);
+       if (vma->vm_pgoff != 0)
+               return -EACCES;
+       return ttm_bo_mmap_obj(vma, &bo->tbo);
  }
  
  /**