OSDN Git Service

drm/amd/display: Add shared DMCUB/driver firmware state cache window
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tue, 12 Nov 2019 18:46:34 +0000 (13:46 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Dec 2019 21:30:43 +0000 (16:30 -0500)
commit2f39835cc35033672ace41f32d653dbf2c0c8132
tree1bab4ea671fcf54334ad1392ba15a8963f2557c8
parentd4bbcecb596296834aeafb93008474671c7988cf
drm/amd/display: Add shared DMCUB/driver firmware state cache window

[Why]
Scratch registers are limited on the DMCUB and we have an expanding
list of state to track between driver and DMCUB.

[How]
Place shared state in cache window 6. The cache window size is aligned
to the size of the cache line on the DMCUB to make it easy to
invalidate.

The shared state is intended to be read only from driver side so
it's been marked as const.

The use of volatile is intentional. The memory for the shared firmware
state is memory mapped from the framebuffer memory. The DMCUB will
flush its cache after modifying the region. There's no way for x86
to known whether this data is stale or not so we want to intentionally
disable optimization to force the read at every access.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/inc/dmub_fw_state.h [new file with mode: 0644]
drivers/gpu/drm/amd/display/dmub/inc/dmub_srv.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn20.h
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn21.h
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c