Merge tag 'drm-next-2022-01-14' of git://anongit.freedesktop.org/drm/drm
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Jan 2022 04:52:38 +0000 (06:52 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Jan 2022 04:52:38 +0000 (06:52 +0200)
Pull drm fixes from Daniel Vetter:
"drivers fixes:

   - i915 fixes for ttm backend + one pm wakelock fix

   - amdgpu fixes, fairly big pile of small things all over. Note this
     doesn't yet containe the fixed version of the otg sync patch that
     blew up

   - small driver fixes: meson, sun4i, vga16fb probe fix

  drm core fixes:

   - cma-buf heap locking

   - ttm compilation

   - self refresh helper state check

   - wrong error message in atomic helpers

   - mipi-dbi buffer mapping"

* tag 'drm-next-2022-01-14' of git://anongit.freedesktop.org/drm/drm: (49 commits)
  drm/mipi-dbi: Fix source-buffer address in mipi_dbi_buf_copy
  drm: fix error found in some cases after the patch d1af5cd86997
  drm/ttm: fix compilation on ARCH=um
  dma-buf: cma_heap: Fix mutex locking section
  video: vga16fb: Only probe for EGA and VGA 16 color graphic cards
  drm/amdkfd: Fix ASIC name typos
  drm/amdkfd: Fix DQM asserts on Hawaii
  drm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2
  drm/amd/pm: only send GmiPwrDnControl msg on master die (v3)
  drm/amdgpu: use spin_lock_irqsave to avoid deadlock by local interrupt
  drm/amdgpu: not return error on the init_apu_flags
  drm/amdkfd: Use prange->update_list head for remove_list
  drm/amdkfd: Use prange->list head for insert_list
  drm/amdkfd: make SPDX License expression more sound
  drm/amdkfd: Check for null pointer after calling kmemdup
  drm/amd/display: invalid parameter check in dmub_hpd_callback
  Revert "drm/amdgpu: Don't inherit GEM object VMAs in child process"
  drm/amd/display: reset dcn31 SMU mailbox on failures
  drm/amdkfd: use default_groups in kobj_type
  drm/amdgpu: use default_groups in kobj_type
  ...

1  2 
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
drivers/gpu/drm/amd/display/dc/inc/resource.h

@@@ -3216,3 -3216,90 +3216,36 @@@ struct hpo_dp_link_encoder *resource_ge
        return hpo_dp_link_enc;
  }
  #endif
 -void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
 -              struct dc_state *context)
 -{
 -      int i, j;
 -      struct pipe_ctx *pipe_ctx_old, *pipe_ctx, *pipe_ctx_syncd;
 -
 -      /* If pipe backend is reset, need to reset pipe syncd status */
 -      for (i = 0; i < dc->res_pool->pipe_count; i++) {
 -              pipe_ctx_old =  &dc->current_state->res_ctx.pipe_ctx[i];
 -              pipe_ctx = &context->res_ctx.pipe_ctx[i];
 -
 -              if (!pipe_ctx_old->stream)
 -                      continue;
 -
 -              if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
 -                      continue;
 -
 -              if (!pipe_ctx->stream ||
 -                              pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
 -
 -                      /* Reset all the syncd pipes from the disabled pipe */
 -                      for (j = 0; j < dc->res_pool->pipe_count; j++) {
 -                              pipe_ctx_syncd = &context->res_ctx.pipe_ctx[j];
 -                              if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_syncd) == pipe_ctx_old->pipe_idx) ||
 -                                      !IS_PIPE_SYNCD_VALID(pipe_ctx_syncd))
 -                                      SET_PIPE_SYNCD_TO_PIPE(pipe_ctx_syncd, j);
 -                      }
 -              }
 -      }
 -}
 -
 -void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
 -      struct dc_state *context,
 -      uint8_t disabled_master_pipe_idx)
 -{
 -      int i;
 -      struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
 -
 -      pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
 -      if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
 -              !IS_PIPE_SYNCD_VALID(pipe_ctx))
 -              SET_PIPE_SYNCD_TO_PIPE(pipe_ctx, disabled_master_pipe_idx);
 -
 -      /* for the pipe disabled, check if any slave pipe exists and assert */
 -      for (i = 0; i < dc->res_pool->pipe_count; i++) {
 -              pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
 -
 -              if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
 -                      IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
 -                      DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
 -                              i, disabled_master_pipe_idx);
 -      }
 -}
 -
+ uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter)
+ {
+       /* TODO - get transmitter to phy idx mapping from DMUB */
+       uint8_t phy_idx = transmitter - TRANSMITTER_UNIPHY_A;
+ #if defined(CONFIG_DRM_AMD_DC_DCN)
+       if (dc->ctx->dce_version == DCN_VERSION_3_1 &&
+                       dc->ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0) {
+               switch (transmitter) {
+               case TRANSMITTER_UNIPHY_A:
+                       phy_idx = 0;
+                       break;
+               case TRANSMITTER_UNIPHY_B:
+                       phy_idx = 1;
+                       break;
+               case TRANSMITTER_UNIPHY_C:
+                       phy_idx = 5;
+                       break;
+               case TRANSMITTER_UNIPHY_D:
+                       phy_idx = 6;
+                       break;
+               case TRANSMITTER_UNIPHY_E:
+                       phy_idx = 4;
+                       break;
+               default:
+                       phy_idx = 0;
+                       break;
+               }
+       }
+ #endif
+       return phy_idx;
+ }
@@@ -208,4 -212,12 +208,6 @@@ struct hpo_dp_link_encoder *resource_ge
                const struct dc_link *link);
  #endif
  
 -void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
 -      struct dc_state *context);
 -
 -void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
 -      struct dc_state *context,
 -      uint8_t disabled_master_pipe_idx);
+ uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter);
  #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */