1. 16 Nov, 2020 23 commits
  2. 13 Nov, 2020 17 commits
    • Bas Nieuwenhuizen's avatar
      drm/amd/display: Extract 3rd plane from metadata · 1331e630
      Bas Nieuwenhuizen authored
      Now that we actually expose the right number of planes we get
      problems with modifier aware libva if we use an unsupported modifier.
      
      So this ensures that we as much as possible use a modifier that
      radeonsi can actually render to without going to extreme difficulty
      to synchronize an extra DCC metadata plane with implicit sync.
      
      Looking into the opaque metadata isn't ideal but this converts to
      something mainly for the purpose of the userspace driver and falls
      back properly if it isn't what we expect.
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      1331e630
    • Bas Nieuwenhuizen's avatar
      drm/amd/display: Set new format info for converted metadata. · 816853f9
      Bas Nieuwenhuizen authored
      If we use DCC modifiers this can increase the number of planes from
      the initial 1 plane with metadata, so that we get a valid modifier
      from getfb2.
      
      Since the code didn't update the format_info getfb2 would only ever
      return 1 plane with a modifier for which userspace expects > 1.
      
      This moves the format lookup to amdgpu_display.c so we do not have
      issues when DC is not compiled.
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      816853f9
    • Bas Nieuwenhuizen's avatar
      drm/amd/display: Store gem objects for planes 1-3 · 3505b2ff
      Bas Nieuwenhuizen authored
      Also do the proper validation which was missed.
      
      Besides the missing validation, not storing the objects in the
      framebuffer led to wrong results in the getfb2 ioctl.
      
      Note that this should really have been done for multi-plane
      formats like NV12 already before modifiers landed.
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      3505b2ff
    • Simon Ser's avatar
      drm/fourcc: add table describing AMD modifiers bit layout · 544645f2
      Simon Ser authored
      The table describes how each bit in the u64 value is used. Explicitly
      state which values a field can take if we have defines for them. Also
      add a note when a field isn't always populated.
      
      Forcing people to update the table when changing the bit layout should
      make it more obvious when there's a mistake, I hope.
      
      If we get to the point where the bit layout gets more complicated, it
      might be worth it to split the table into multiple tables (e.g. one for
      GFX8, one for GFX9+, and so on).
      Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
      Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      544645f2
    • Bas Nieuwenhuizen's avatar
      drm/fourcc: Fix modifier field mask for AMD modifiers. · b7397bad
      Bas Nieuwenhuizen authored
      The DCC_MAX_COMPRESSED_BLOCK has to contain one of
      AMD_FMT_MOD_DCC_BLOCK_* and with 3 values this doesn't
      fit in 1 bit.
      
      Fix this cleanly while it is only in drm-next.
      
      Fixes: 8ba16d59 ("drm/fourcc: Add AMD DRM modifiers.")
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b7397bad
    • Alex Deucher's avatar
      drm/amd/display: Add missing pflip irq for dcn2.0 · 52f6f16d
      Alex Deucher authored
      If we have more than 4 displays we will run
      into dummy irq calls or flip timout issues.
      Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      52f6f16d
    • Lee Jones's avatar
      drm/amd/amdgpu/gfx_v7_0: Remove unused struct definition · b3d65296
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c:5211:45: warning: ‘gfx_v7_0_ip_block’ defined but not used [-Wunused-const-variable=]
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b3d65296
    • Lee Jones's avatar
      drm/amd/amdgpu/smu_v11_0_i2c: Provide descriptions for 'control' and 'data' params · 048df826
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c:225: warning: Function parameter or member 'control' not described in 'smu_v11_0_i2c_transmit'
       drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c:325: warning: Function parameter or member 'control' not described in 'smu_v11_0_i2c_receive'
       drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c:325: warning: Function parameter or member 'data' not described in 'smu_v11_0_i2c_receive'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      048df826
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_fw_attestation: Consume our own header containing prototypes · 0507a617
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:130:6: warning: no previous prototype for ‘amdgpu_fw_attestation_debugfs_init’ [-Wmissing-prototypes]
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Hawking Zhang <Hawking.Zhang@amd.com>
      Cc: John Clements <john.clements@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      0507a617
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_vm_sdma: Fix 'amdgpu_vm_sdma_prepare()'s doc-rot · dc370a67
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c:63: warning: Function parameter or member 'resv' not described in 'amdgpu_vm_sdma_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c:63: warning: Function parameter or member 'sync_mode' not described in 'amdgpu_vm_sdma_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c:63: warning: Excess function parameter 'owner' description in 'amdgpu_vm_sdma_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c:63: warning: Excess function parameter 'exclusive' description in 'amdgpu_vm_sdma_prepare'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      dc370a67
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_vm_cpu: Fix 'amdgpu_vm_cpu_prepare()'s doc-rot · 7eff65d6
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c:50: warning: Function parameter or member 'resv' not described in 'amdgpu_vm_cpu_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c:50: warning: Function parameter or member 'sync_mode' not described in 'amdgpu_vm_cpu_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c:50: warning: Excess function parameter 'owner' description in 'amdgpu_vm_cpu_prepare'
       drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c:50: warning: Excess function parameter 'exclusive' description in 'amdgpu_vm_cpu_prepare'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      7eff65d6
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_ras: Make local function 'amdgpu_ras_error_status_query' static · cd92df93
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1482:6: warning: no previous prototype for ‘amdgpu_ras_error_status_query’ [-Wmissing-prototypes]
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      cd92df93
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_ras: Remove unused function 'amdgpu_ras_error_cure' · 32dc5348
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:908:5: warning: no previous prototype for ‘amdgpu_ras_error_cure’ [-Wmissing-prototypes]
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      32dc5348
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_gmc: Demote one and fix another function header · ff08711c
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c:69: warning: Function parameter or member 'bo' not described in 'amdgpu_gmc_pd_addr'
       drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c:121: warning: Function parameter or member 'bo' not described in 'amdgpu_gmc_agp_addr'
       drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c:121: warning: Excess function parameter 'tbo' description in 'amdgpu_gmc_agp_addr'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ff08711c
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_debugfs: Demote obvious abuse of kernel-doc formatting · 20ed491b
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:308: warning: Function parameter or member 'f' not described in 'amdgpu_debugfs_regs_read'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:308: warning: Function parameter or member 'buf' not described in 'amdgpu_debugfs_regs_read'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:308: warning: Function parameter or member 'size' not described in 'amdgpu_debugfs_regs_read'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:308: warning: Function parameter or member 'pos' not described in 'amdgpu_debugfs_regs_read'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:317: warning: Function parameter or member 'f' not described in 'amdgpu_debugfs_regs_write'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:317: warning: Function parameter or member 'buf' not described in 'amdgpu_debugfs_regs_write'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:317: warning: Function parameter or member 'size' not described in 'amdgpu_debugfs_regs_write'
       drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:317: warning: Function parameter or member 'pos' not described in 'amdgpu_debugfs_regs_write'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      20ed491b
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_ids: Supply missing docs for 'id' and 'vmhub' · 8ebc6df6
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c:271: warning: Function parameter or member 'id' not described in 'amdgpu_vmid_grab_reserved'
       drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c:523: warning: Function parameter or member 'vmhub' not described in 'amdgpu_vmid_reset'
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-media@vger.kernel.org
      Cc: linaro-mm-sig@lists.linaro.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8ebc6df6
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_sched: Consume our own header containing prototypes · 793c8571
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c:35:5: warning: no previous prototype for ‘amdgpu_to_sched_priority’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c:122:5: warning: no previous prototype for ‘amdgpu_sched_ioctl’ [-Wmissing-prototypes]
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Luben Tuikov <luben.tuikov@amd.com>
      Cc: Andres Rodriguez <andresx7@gmail.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      793c8571