OSDN Git Service

Merge tag 'amd-drm-next-5.7-2020-03-10' of git://people.freedesktop.org/~agd5f/linux...
authorDave Airlie <airlied@redhat.com>
Thu, 12 Mar 2020 23:09:11 +0000 (09:09 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 12 Mar 2020 23:09:11 +0000 (09:09 +1000)
amd-drm-next-5.7-2020-03-10:

amdgpu:
- SR-IOV fixes
- Fix up fallout from drm load/unload callback removal
- Navi, renoir power management watermark fixes
- Refactor smu parameter handling
- Display FEC fixes
- Display DCC fixes
- HDCP fixes
- Add support for USB-C PD firmware updates
- Pollock detection fix
- Rework compute ring priority handling
- RAS fixes
- Misc cleanups

amdkfd:
- Consolidate more gfx config details in amdgpu
- Consolidate bo alloc flags
- Improve code comments
- SDMA MQD fixes
- Misc cleanups

gpu scheduler:
- Add suport for modifying the sched list

uapi:
- Clarify comments about GEM_CREATE flags that are not used by userspace.
  The kernel driver has always prevented userspace from using these.
  They are only used internally in the kernel driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200310212748.4519-1-alexander.deucher@amd.com
1  2 
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

@@@ -28,7 -28,6 +28,7 @@@
  #include <linux/file.h>
  #include <linux/pagemap.h>
  #include <linux/sync_file.h>
 +#include <linux/dma-buf.h>
  
  #include <drm/amdgpu_drm.h>
  #include <drm/drm_syncobj.h>
@@@ -416,9 -415,7 +416,9 @@@ static int amdgpu_cs_bo_validate(struc
        /* Don't move this buffer if we have depleted our allowance
         * to move it. Don't move anything if the threshold is zero.
         */
 -      if (p->bytes_moved < p->bytes_moved_threshold) {
 +      if (p->bytes_moved < p->bytes_moved_threshold &&
 +          (!bo->tbo.base.dma_buf ||
 +          list_empty(&bo->tbo.base.dma_buf->attachments))) {
                if (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&
                    (bo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)) {
                        /* And don't move a CPU_ACCESS_REQUIRED BO to limited
@@@ -1208,7 -1205,6 +1208,6 @@@ static int amdgpu_cs_submit(struct amdg
        struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
        struct drm_sched_entity *entity = p->entity;
        enum drm_sched_priority priority;
-       struct amdgpu_ring *ring;
        struct amdgpu_bo_list_entry *e;
        struct amdgpu_job *job;
        uint64_t seq;
        priority = job->base.s_priority;
        drm_sched_entity_push_job(&job->base, entity);
  
-       ring = to_amdgpu_ring(entity->rq->sched);
-       amdgpu_ring_priority_get(ring, priority);
        amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm);
  
        ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence);
@@@ -31,7 -31,6 +31,7 @@@
   */
  #include <linux/list.h>
  #include <linux/slab.h>
 +#include <linux/dma-buf.h>
  
  #include <drm/amdgpu_drm.h>
  #include <drm/drm_cache.h>
@@@ -926,9 -925,6 +926,9 @@@ int amdgpu_bo_pin_restricted(struct amd
                return 0;
        }
  
 +      if (bo->tbo.base.import_attach)
 +              dma_buf_pin(bo->tbo.base.import_attach);
 +
        bo->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
        /* force to pin into visible video ram */
        if (!(bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS))
@@@ -1012,9 -1008,6 +1012,9 @@@ int amdgpu_bo_unpin(struct amdgpu_bo *b
  
        amdgpu_bo_subtract_pin_size(bo);
  
 +      if (bo->tbo.base.import_attach)
 +              dma_buf_unpin(bo->tbo.base.import_attach);
 +
        for (i = 0; i < bo->placement.num_placement; i++) {
                bo->placements[i].lpfn = 0;
                bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
@@@ -1281,10 -1274,6 +1281,10 @@@ void amdgpu_bo_move_notify(struct ttm_b
  
        amdgpu_bo_kunmap(abo);
  
 +      if (abo->tbo.base.dma_buf && !abo->tbo.base.import_attach &&
 +          bo->mem.mem_type != TTM_PL_SYSTEM)
 +              dma_buf_move_notify(abo->tbo.base.dma_buf);
 +
        /* remember the eviction */
        if (evict)
                atomic64_inc(&adev->num_evictions);
@@@ -1319,7 -1308,8 +1319,8 @@@ void amdgpu_bo_release_notify(struct tt
                amdgpu_amdkfd_unreserve_memory_limit(abo);
  
        /* We only remove the fence if the resv has individualized. */
-       WARN_ON_ONCE(bo->base.resv != &bo->base._resv);
+       WARN_ON_ONCE(bo->type == ttm_bo_type_kernel
+                       && bo->base.resv != &bo->base._resv);
        if (bo->base.resv == &bo->base._resv)
                amdgpu_amdkfd_remove_fence_on_pt_pd_bos(abo);
  
@@@ -207,7 -207,7 +207,7 @@@ static bool validate_dsc_caps_on_connec
  
        if (!dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
                                   dsc_caps, NULL,
-                                  &dc_sink->sink_dsc_caps.dsc_dec_caps))
+                                  &dc_sink->dsc_caps.dsc_dec_caps))
                return false;
  
        return true;
@@@ -262,8 -262,8 +262,8 @@@ static int dm_dp_mst_get_modes(struct d
  
  #if defined(CONFIG_DRM_AMD_DC_DCN)
                        if (!validate_dsc_caps_on_connector(aconnector))
-                               memset(&aconnector->dc_sink->sink_dsc_caps,
-                                      0, sizeof(aconnector->dc_sink->sink_dsc_caps));
+                               memset(&aconnector->dc_sink->dsc_caps,
+                                      0, sizeof(aconnector->dc_sink->dsc_caps));
  #endif
                }
        }
@@@ -440,6 -440,9 +440,6 @@@ dm_dp_add_mst_connector(struct drm_dp_m
  static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
                                        struct drm_connector *connector)
  {
 -      struct amdgpu_dm_connector *master = container_of(mgr, struct amdgpu_dm_connector, mst_mgr);
 -      struct drm_device *dev = master->base.dev;
 -      struct amdgpu_device *adev = dev->dev_private;
        struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
  
        DRM_INFO("DM_MST: Disabling connector: %p [id: %d] [master: %p]\n",
        }
  
        drm_connector_unregister(connector);
 -      if (adev->mode_info.rfbdev)
 -              drm_fb_helper_remove_one_connector(&adev->mode_info.rfbdev->helper, connector);
        drm_connector_put(connector);
  }
  
  static void dm_dp_mst_register_connector(struct drm_connector *connector)
  {
 -      struct drm_device *dev = connector->dev;
 -      struct amdgpu_device *adev = dev->dev_private;
 -
 -      if (adev->mode_info.rfbdev)
 -              drm_fb_helper_add_one_connector(&adev->mode_info.rfbdev->helper, connector);
 -      else
 -              DRM_ERROR("adev->mode_info.rfbdev is NULL\n");
 -
        drm_connector_register(connector);
  }
  
@@@ -537,7 -550,7 +537,7 @@@ static void set_dsc_configs_from_fairne
                memset(&params[i].timing->dsc_cfg, 0, sizeof(params[i].timing->dsc_cfg));
                if (vars[i].dsc_enabled && dc_dsc_compute_config(
                                        params[i].sink->ctx->dc->res_pool->dscs[0],
-                                       &params[i].sink->sink_dsc_caps.dsc_dec_caps,
+                                       &params[i].sink->dsc_caps.dsc_dec_caps,
                                        params[i].sink->ctx->dc->debug.dsc_min_slice_height_override,
                                        0,
                                        params[i].timing,
@@@ -558,7 -571,7 +558,7 @@@ static int bpp_x16_from_pbn(struct dsc_
        kbps = div_u64((u64)pbn * 994 * 8 * 54, 64);
        dc_dsc_compute_config(
                        param.sink->ctx->dc->res_pool->dscs[0],
-                       &param.sink->sink_dsc_caps.dsc_dec_caps,
+                       &param.sink->dsc_caps.dsc_dec_caps,
                        param.sink->ctx->dc->debug.dsc_min_slice_height_override,
                        (int) kbps, param.timing, &dsc_config);
  
@@@ -755,14 -768,14 +755,14 @@@ static bool compute_mst_dsc_configs_for
                params[count].sink = stream->sink;
                aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
                params[count].port = aconnector->port;
-               params[count].compression_possible = stream->sink->sink_dsc_caps.dsc_dec_caps.is_dsc_supported;
+               params[count].compression_possible = stream->sink->dsc_caps.dsc_dec_caps.is_dsc_supported;
                dc_dsc_get_policy_for_timing(params[count].timing, &dsc_policy);
                if (!dc_dsc_compute_bandwidth_range(
                                stream->sink->ctx->dc->res_pool->dscs[0],
                                stream->sink->ctx->dc->debug.dsc_min_slice_height_override,
                                dsc_policy.min_target_bpp,
                                dsc_policy.max_target_bpp,
-                               &stream->sink->sink_dsc_caps.dsc_dec_caps,
+                               &stream->sink->dsc_caps.dsc_dec_caps,
                                &stream->timing, &params[count].bw_range))
                        params[count].bw_range.stream_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing);
  
@@@ -844,7 -857,7 +844,7 @@@ bool compute_mst_dsc_configs_for_state(
                if (!aconnector || !aconnector->dc_sink)
                        continue;
  
-               if (!aconnector->dc_sink->sink_dsc_caps.dsc_dec_caps.is_dsc_supported)
+               if (!aconnector->dc_sink->dsc_caps.dsc_dec_caps.is_dsc_supported)
                        continue;
  
                if (computed_streams[i])