1. 02 Jun, 2021 25 commits
  2. 27 May, 2021 15 commits
    • Mario Kleiner's avatar
      drm/amd/display: Enable support for 16 bpc fixed-point framebuffers. · 58020403
      Mario Kleiner authored
      This is intended to enable direct high-precision scanout and pageflip
      of Vulkan swapchain images in format VK_FORMAT_R16G16B16A16_UNORM.
      
      Expose DRM_FORMAT_XRGB16161616, DRM_FORMAT_ARGB16161616,
      DRM_FORMAT_XBGR16161616 and DRM_FORMAT_ABGR16161616 as 16 bpc
      unsigned normalized formats. These allow to take full advantage
      of the maximum precision of the display hardware, ie. currently
      up to 12 bpc.
      
      Searching through old AMD M56, M76 and RV630 hw programming docs
      suggests that these 16 bpc formats are supported by all DCE and
      DCN display engines, so we can expose the formats unconditionally.
      
      Successfully tested on AMD Polaris11 DCE-11.2 an RavenRidge DCN-1.0
      with a HDR-10 monitor over 10 bpc DP output with spatial dithering
      enabled by the driver. Picture looks good, and my photometer
      measurement procedure confirms an effective 12 bpc color
      reproduction.
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      58020403
    • Mario Kleiner's avatar
      drm/amd/display: Make assert in DCE's program_bit_depth_reduction more lenient. · 92e2b820
      Mario Kleiner authored
      This is needed to avoid warnings with linebuffer depth 36 bpp.
      Testing on a Polaris11, DCE-11.2 on a 10 bit HDR-10 monitor
      showed no obvious problems, and this 12 bpc limit is consistent
      with what other function in the DCE bit depth reduction path use.
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      92e2b820
    • Mario Kleiner's avatar
      drm/amd/display: Increase linebuffer pixel depth to 36bpp. · a316db72
      Mario Kleiner authored
      Testing with the photometer shows that at least Raven Ridge DCN-1.0
      does not achieve more than 10 bpc effective output precision with a
      16 bpc unorm surface of type SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616,
      unless linebuffer depth is increased from LB_PIXEL_DEPTH_30BPP to
      LB_PIXEL_DEPTH_36BPP. Otherwise precision gets truncated somewhere
      to 10 bpc effective depth.
      
      Strangely this increase was not needed on Polaris11 DCE-11.2 during
      testing to get 12 bpc effective precision. It also is not needed for
      fp16 framebuffers.
      
      Tested on DCN-1.0 and DCE-11.2.
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      a316db72
    • Mario Kleiner's avatar
      drm/amd/display: Add support for SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616. · 050cd3d6
      Mario Kleiner authored
      Add the necessary format definition, bandwidth and pixel size mappings,
      prescaler setup, and pixelformat selection, following the logic
      already present for SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616.
      
      The new SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616 is implemented as the
      old SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616 format, but with swapped
      red <-> green color channel, by use of the hardware xbar.
      
      Please note that on the DCN 1/2/3 display engines, the pixelformat
      in hubp and dpp setup for the old SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616
      and the new SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616 was changed from
      format id 22 to id 26. See amd/include/navi10_enum.h for the meaning
      of the id's.
      
      For format 22, the display engine read the framebuffer in 16 bpc format,
      but truncated to the 12 bpc actually supported by later pipeline stages.
      However, the engine took the 12 LSB of each color component for
      truncation, which is incompatible with rendering at least under Vulkan,
      where content is 16 bit wide, and a 12 MSB alignment would be appropriate,
      if any. Format 20 for ARGB16161616_12MSB does work, but even better, we
      can choose format 26 for ARGB16161616_UNORM, keeping all 16 bits around
      until later stages of the display pipeline.
      
      This allows to directly consume what the rendering hw produces under
      Vulkan for swapchain format VK_FORMAT_R16G16B16A16_UNORM, as tested
      with a patched version of the current AMD open-source amdvlk driver
      which maps swapchain format VK_FORMAT_R16G16B16A16_UNORM onto
      DRM_FORMAT_XBGR16161616.
      
      The old id 22 would cause colorful pixeltrash to be displayed instead.
      
      Tested under DCN-1.0 and DCE-11.2.
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      050cd3d6
    • Mario Kleiner's avatar
      drm/fourcc: Add 16 bpc fixed point framebuffer formats. · ff92ecf5
      Mario Kleiner authored
      These are 16 bits per color channel unsigned normalized formats.
      They are supported by at least AMD display hw, and suitable for
      direct scanout of Vulkan swapchain images in the format
      VK_FORMAT_R16G16B16A16_UNORM.
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ff92ecf5
    • Alex Deucher's avatar
      drm/amdgpu/acpi: make ATPX/ATCS structures global (v2) · f9b7f370
      Alex Deucher authored
      They are global ACPI methods, so maybe the structures
      global in the driver. This simplified a number of things
      in the handling of these methods.
      
      v2: reset the handle if verify interface fails (Lijo)
      v3: fix compilation when ACPI is not defined.
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f9b7f370
    • Victor Zhao's avatar
      drm/amd/amdgpu:save psp ring wptr to avoid attack · f1688bd6
      Victor Zhao authored
      [Why]
      When some tools performing psp mailbox attack, the readback value
      of register can be a random value which may break psp.
      
      [How]
      Use a psp wptr cache machanism to aovid the change made by attack.
      
      v2: unify change and add detailed reason
      Signed-off-by: default avatarVictor Zhao <Victor.Zhao@amd.com>
      Signed-off-by: default avatarJingwen Chen <Jingwen.Chen2@amd.com>
      Reviewed-by: default avatarMonk Liu <monk.liu@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f1688bd6
    • Alex Deucher's avatar
      drm/amdgpu/swsmu/aldebaran: fix check in is_dpm_running · dd1d82c0
      Alex Deucher authored
      If smu_cmn_get_enabled_mask() fails, return false to be
      consistent with other asics.
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: Lee Jones <lee.jones@linaro.org>
      Reviewed-by: default avatarLee Jones <lee.jones@linaro.org>
      dd1d82c0
    • Lee Jones's avatar
      drm/amd/display/modules/hdcp/hdcp_psp: Remove unused function... · c1b63b4b
      Lee Jones authored
      drm/amd/display/modules/hdcp/hdcp_psp: Remove unused function 'mod_hdcp_hdcp1_get_link_encryption_status()'
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_psp.c:374:22: warning: no previous prototype for ‘mod_hdcp_hdcp1_get_link_encryption_status’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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>
      c1b63b4b
    • Lee Jones's avatar
      drm/amd/display/dmub/src/dmub_srv_stat: Convert function header to kernel-doc · 397d0c46
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv_stat.c:38: warning: Cannot understand  *****************************************************************************
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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: Jun Lei <Jun.Lei@amd.com>
      Cc: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
      Cc: Rodrigo Siqueira <Rodrigo.Siqueira@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>
      397d0c46
    • Lee Jones's avatar
      drm/amd/display/dc/core/dc: Convert function headers to kernel-doc · c45f6173
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3324: warning: Cannot understand  *****************************************************************************
       drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3344: warning: Cannot understand  *****************************************************************************
       drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3417: warning: Cannot understand  *****************************************************************************
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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>
      c45f6173
    • Lee Jones's avatar
      drm/amd/display/dc/dce110/dce110_hw_sequencer: Include header containing our prototypes · a76eb7d3
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:929:6: warning: no previous prototype for ‘dce110_edp_wait_for_T12’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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>
      a76eb7d3
    • Lee Jones's avatar
      drm/amd/display/amdgpu_dm/amdgpu_dm: Fix kernel-doc formatting issue · 48e01bf4
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:608: warning: Function parameter or member 'interrupt_params' not described in 'dm_dcn_vertical_interrupt0_high_irq'
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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>
      48e01bf4
    • Lee Jones's avatar
      drm/amd/amdgpu/amdgpu_device: Make local function static · 9d8d96be
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4624:6: warning: no previous prototype for ‘amdgpu_device_recheck_guilty_jobs’ [-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: 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>
      9d8d96be
    • Lee Jones's avatar
      drm/amd/display/dc/dce/dce_mem_input: Remove duplicate initialisation of... · 913d18d2
      Lee Jones authored
      drm/amd/display/dc/dce/dce_mem_input: Remove duplicate initialisation of GRPH_CONTROL__GRPH_NUM_BANKS_{SHIFT, MASK
      
      Fixes the following W=1 kernel build warning(s):
      
       In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:29:
       drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_sh_mask.h:7270:45: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:155:28: note: in expansion of macro ‘GRPH_CONTROL__GRPH_NUM_BANKS__SHIFT’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:159:2: note: in expansion of macro ‘SFB’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:264:2: note: in expansion of macro ‘MI_GFX6_TILE_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:657:3: note: in expansion of macro ‘MI_DCE6_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_sh_mask.h:7270:45: note: (near initialization for ‘mi_shifts.GRPH_NUM_BANKS’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:155:28: note: in expansion of macro ‘GRPH_CONTROL__GRPH_NUM_BANKS__SHIFT’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:159:2: note: in expansion of macro ‘SFB’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:264:2: note: in expansion of macro ‘MI_GFX6_TILE_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:657:3: note: in expansion of macro ‘MI_DCE6_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_sh_mask.h:7269:43: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:155:28: note: in expansion of macro ‘GRPH_CONTROL__GRPH_NUM_BANKS_MASK’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:159:2: note: in expansion of macro ‘SFB’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:264:2: note: in expansion of macro ‘MI_GFX6_TILE_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:662:3: note: in expansion of macro ‘MI_DCE6_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_sh_mask.h:7269:43: note: (near initialization for ‘mi_masks.GRPH_NUM_BANKS’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:155:28: note: in expansion of macro ‘GRPH_CONTROL__GRPH_NUM_BANKS_MASK’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:159:2: note: in expansion of macro ‘SFB’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_mem_input.h:264:2: note: in expansion of macro ‘MI_GFX6_TILE_MASK_SH_LIST’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:662:3: note: in expansion of macro ‘MI_DCE6_MASK_SH_LIST’
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      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: Mauro Rossi <issor.oruam@gmail.com>
      Cc: Lee Jones <lee.jones@linaro.org>
      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>
      913d18d2