Commit 124764f1 authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher

drm/radeon: s/ioctl_wait_idle/mmio_hpd_flush/

And clean up the function comment a little.
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f28be810
...@@ -4088,16 +4088,15 @@ int r600_debugfs_mc_info_init(struct radeon_device *rdev) ...@@ -4088,16 +4088,15 @@ int r600_debugfs_mc_info_init(struct radeon_device *rdev)
} }
/** /**
* r600_ioctl_wait_idle - flush host path cache on wait idle ioctl * r600_mmio_hdp_flush - flush Host Data Path cache via MMIO
* rdev: radeon device structure * rdev: radeon device structure
* bo: buffer object struct which userspace is waiting for idle
* *
* Some R6XX/R7XX doesn't seems to take into account HDP flush performed * Some R6XX/R7XX don't seem to take into account HDP flushes performed
* through ring buffer, this leads to corruption in rendering, see * through the ring buffer. This leads to corruption in rendering, see
* http://bugzilla.kernel.org/show_bug.cgi?id=15186 to avoid this we * http://bugzilla.kernel.org/show_bug.cgi?id=15186 . To avoid this, we
* directly perform HDP flush by writing register through MMIO. * directly perform the HDP flush by writing the register through MMIO.
*/ */
void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) void r600_mmio_hdp_flush(struct radeon_device *rdev)
{ {
/* r7xx hw bug. write to HDP_DEBUG1 followed by fb read /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read
* rather than write to HDP_REG_COHERENCY_FLUSH_CNTL. * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL.
......
...@@ -1772,13 +1772,8 @@ struct radeon_asic { ...@@ -1772,13 +1772,8 @@ struct radeon_asic {
int (*suspend)(struct radeon_device *rdev); int (*suspend)(struct radeon_device *rdev);
void (*vga_set_state)(struct radeon_device *rdev, bool state); void (*vga_set_state)(struct radeon_device *rdev, bool state);
int (*asic_reset)(struct radeon_device *rdev); int (*asic_reset)(struct radeon_device *rdev);
/* ioctl hw specific callback. Some hw might want to perform special /* Flush the HDP cache via MMIO */
* operation on specific ioctl. For instance on wait idle some hw void (*mmio_hdp_flush)(struct radeon_device *rdev);
* might want to perform and HDP flush through MMIO as it seems that
* some R6XX/R7XX hw doesn't take HDP flush into account if programmed
* through ring.
*/
void (*ioctl_wait_idle)(struct radeon_device *rdev, struct radeon_bo *bo);
/* check if 3D engine is idle */ /* check if 3D engine is idle */
bool (*gui_idle)(struct radeon_device *rdev); bool (*gui_idle)(struct radeon_device *rdev);
/* wait for mc_idle */ /* wait for mc_idle */
......
...@@ -194,7 +194,7 @@ static struct radeon_asic r100_asic = { ...@@ -194,7 +194,7 @@ static struct radeon_asic r100_asic = {
.resume = &r100_resume, .resume = &r100_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r100_asic_reset, .asic_reset = &r100_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r100_mc_wait_for_idle, .mc_wait_for_idle = &r100_mc_wait_for_idle,
.gart = { .gart = {
...@@ -260,7 +260,7 @@ static struct radeon_asic r200_asic = { ...@@ -260,7 +260,7 @@ static struct radeon_asic r200_asic = {
.resume = &r100_resume, .resume = &r100_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r100_asic_reset, .asic_reset = &r100_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r100_mc_wait_for_idle, .mc_wait_for_idle = &r100_mc_wait_for_idle,
.gart = { .gart = {
...@@ -340,7 +340,7 @@ static struct radeon_asic r300_asic = { ...@@ -340,7 +340,7 @@ static struct radeon_asic r300_asic = {
.resume = &r300_resume, .resume = &r300_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r300_asic_reset, .asic_reset = &r300_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r300_mc_wait_for_idle, .mc_wait_for_idle = &r300_mc_wait_for_idle,
.gart = { .gart = {
...@@ -406,7 +406,7 @@ static struct radeon_asic r300_asic_pcie = { ...@@ -406,7 +406,7 @@ static struct radeon_asic r300_asic_pcie = {
.resume = &r300_resume, .resume = &r300_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r300_asic_reset, .asic_reset = &r300_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r300_mc_wait_for_idle, .mc_wait_for_idle = &r300_mc_wait_for_idle,
.gart = { .gart = {
...@@ -472,7 +472,7 @@ static struct radeon_asic r420_asic = { ...@@ -472,7 +472,7 @@ static struct radeon_asic r420_asic = {
.resume = &r420_resume, .resume = &r420_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r300_asic_reset, .asic_reset = &r300_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r300_mc_wait_for_idle, .mc_wait_for_idle = &r300_mc_wait_for_idle,
.gart = { .gart = {
...@@ -538,7 +538,7 @@ static struct radeon_asic rs400_asic = { ...@@ -538,7 +538,7 @@ static struct radeon_asic rs400_asic = {
.resume = &rs400_resume, .resume = &rs400_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &r300_asic_reset, .asic_reset = &r300_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &rs400_mc_wait_for_idle, .mc_wait_for_idle = &rs400_mc_wait_for_idle,
.gart = { .gart = {
...@@ -604,7 +604,7 @@ static struct radeon_asic rs600_asic = { ...@@ -604,7 +604,7 @@ static struct radeon_asic rs600_asic = {
.resume = &rs600_resume, .resume = &rs600_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &rs600_asic_reset, .asic_reset = &rs600_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &rs600_mc_wait_for_idle, .mc_wait_for_idle = &rs600_mc_wait_for_idle,
.gart = { .gart = {
...@@ -672,7 +672,7 @@ static struct radeon_asic rs690_asic = { ...@@ -672,7 +672,7 @@ static struct radeon_asic rs690_asic = {
.resume = &rs690_resume, .resume = &rs690_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &rs600_asic_reset, .asic_reset = &rs600_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &rs690_mc_wait_for_idle, .mc_wait_for_idle = &rs690_mc_wait_for_idle,
.gart = { .gart = {
...@@ -740,7 +740,7 @@ static struct radeon_asic rv515_asic = { ...@@ -740,7 +740,7 @@ static struct radeon_asic rv515_asic = {
.resume = &rv515_resume, .resume = &rv515_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &rs600_asic_reset, .asic_reset = &rs600_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &rv515_mc_wait_for_idle, .mc_wait_for_idle = &rv515_mc_wait_for_idle,
.gart = { .gart = {
...@@ -806,7 +806,7 @@ static struct radeon_asic r520_asic = { ...@@ -806,7 +806,7 @@ static struct radeon_asic r520_asic = {
.resume = &r520_resume, .resume = &r520_resume,
.vga_set_state = &r100_vga_set_state, .vga_set_state = &r100_vga_set_state,
.asic_reset = &rs600_asic_reset, .asic_reset = &rs600_asic_reset,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.mc_wait_for_idle = &r520_mc_wait_for_idle, .mc_wait_for_idle = &r520_mc_wait_for_idle,
.gart = { .gart = {
...@@ -898,7 +898,7 @@ static struct radeon_asic r600_asic = { ...@@ -898,7 +898,7 @@ static struct radeon_asic r600_asic = {
.resume = &r600_resume, .resume = &r600_resume,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.asic_reset = &r600_asic_reset, .asic_reset = &r600_asic_reset,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &r600_mc_wait_for_idle, .mc_wait_for_idle = &r600_mc_wait_for_idle,
.get_xclk = &r600_get_xclk, .get_xclk = &r600_get_xclk,
...@@ -970,7 +970,7 @@ static struct radeon_asic rv6xx_asic = { ...@@ -970,7 +970,7 @@ static struct radeon_asic rv6xx_asic = {
.resume = &r600_resume, .resume = &r600_resume,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.asic_reset = &r600_asic_reset, .asic_reset = &r600_asic_reset,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &r600_mc_wait_for_idle, .mc_wait_for_idle = &r600_mc_wait_for_idle,
.get_xclk = &r600_get_xclk, .get_xclk = &r600_get_xclk,
...@@ -1060,7 +1060,7 @@ static struct radeon_asic rs780_asic = { ...@@ -1060,7 +1060,7 @@ static struct radeon_asic rs780_asic = {
.resume = &r600_resume, .resume = &r600_resume,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.asic_reset = &r600_asic_reset, .asic_reset = &r600_asic_reset,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &r600_mc_wait_for_idle, .mc_wait_for_idle = &r600_mc_wait_for_idle,
.get_xclk = &r600_get_xclk, .get_xclk = &r600_get_xclk,
...@@ -1163,7 +1163,7 @@ static struct radeon_asic rv770_asic = { ...@@ -1163,7 +1163,7 @@ static struct radeon_asic rv770_asic = {
.resume = &rv770_resume, .resume = &rv770_resume,
.asic_reset = &r600_asic_reset, .asic_reset = &r600_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &r600_mc_wait_for_idle, .mc_wait_for_idle = &r600_mc_wait_for_idle,
.get_xclk = &rv770_get_xclk, .get_xclk = &rv770_get_xclk,
...@@ -1281,7 +1281,7 @@ static struct radeon_asic evergreen_asic = { ...@@ -1281,7 +1281,7 @@ static struct radeon_asic evergreen_asic = {
.resume = &evergreen_resume, .resume = &evergreen_resume,
.asic_reset = &evergreen_asic_reset, .asic_reset = &evergreen_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &rv770_get_xclk, .get_xclk = &rv770_get_xclk,
...@@ -1373,7 +1373,7 @@ static struct radeon_asic sumo_asic = { ...@@ -1373,7 +1373,7 @@ static struct radeon_asic sumo_asic = {
.resume = &evergreen_resume, .resume = &evergreen_resume,
.asic_reset = &evergreen_asic_reset, .asic_reset = &evergreen_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &r600_get_xclk, .get_xclk = &r600_get_xclk,
...@@ -1464,7 +1464,7 @@ static struct radeon_asic btc_asic = { ...@@ -1464,7 +1464,7 @@ static struct radeon_asic btc_asic = {
.resume = &evergreen_resume, .resume = &evergreen_resume,
.asic_reset = &evergreen_asic_reset, .asic_reset = &evergreen_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &rv770_get_xclk, .get_xclk = &rv770_get_xclk,
...@@ -1599,7 +1599,7 @@ static struct radeon_asic cayman_asic = { ...@@ -1599,7 +1599,7 @@ static struct radeon_asic cayman_asic = {
.resume = &cayman_resume, .resume = &cayman_resume,
.asic_reset = &cayman_asic_reset, .asic_reset = &cayman_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &rv770_get_xclk, .get_xclk = &rv770_get_xclk,
...@@ -1699,7 +1699,7 @@ static struct radeon_asic trinity_asic = { ...@@ -1699,7 +1699,7 @@ static struct radeon_asic trinity_asic = {
.resume = &cayman_resume, .resume = &cayman_resume,
.asic_reset = &cayman_asic_reset, .asic_reset = &cayman_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &r600_get_xclk, .get_xclk = &r600_get_xclk,
...@@ -1829,7 +1829,7 @@ static struct radeon_asic si_asic = { ...@@ -1829,7 +1829,7 @@ static struct radeon_asic si_asic = {
.resume = &si_resume, .resume = &si_resume,
.asic_reset = &si_asic_reset, .asic_reset = &si_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = r600_ioctl_wait_idle, .mmio_hdp_flush = r600_mmio_hdp_flush,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &si_get_xclk, .get_xclk = &si_get_xclk,
...@@ -1987,7 +1987,7 @@ static struct radeon_asic ci_asic = { ...@@ -1987,7 +1987,7 @@ static struct radeon_asic ci_asic = {
.resume = &cik_resume, .resume = &cik_resume,
.asic_reset = &cik_asic_reset, .asic_reset = &cik_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &cik_get_xclk, .get_xclk = &cik_get_xclk,
...@@ -2091,7 +2091,7 @@ static struct radeon_asic kv_asic = { ...@@ -2091,7 +2091,7 @@ static struct radeon_asic kv_asic = {
.resume = &cik_resume, .resume = &cik_resume,
.asic_reset = &cik_asic_reset, .asic_reset = &cik_asic_reset,
.vga_set_state = &r600_vga_set_state, .vga_set_state = &r600_vga_set_state,
.ioctl_wait_idle = NULL, .mmio_hdp_flush = NULL,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.mc_wait_for_idle = &evergreen_mc_wait_for_idle, .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
.get_xclk = &cik_get_xclk, .get_xclk = &cik_get_xclk,
......
...@@ -351,7 +351,7 @@ void r600_hpd_fini(struct radeon_device *rdev); ...@@ -351,7 +351,7 @@ void r600_hpd_fini(struct radeon_device *rdev);
bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
void r600_hpd_set_polarity(struct radeon_device *rdev, void r600_hpd_set_polarity(struct radeon_device *rdev,
enum radeon_hpd_id hpd); enum radeon_hpd_id hpd);
extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo); extern void r600_mmio_hdp_flush(struct radeon_device *rdev);
extern bool r600_gui_idle(struct radeon_device *rdev); extern bool r600_gui_idle(struct radeon_device *rdev);
extern void r600_pm_misc(struct radeon_device *rdev); extern void r600_pm_misc(struct radeon_device *rdev);
extern void r600_pm_init_profile(struct radeon_device *rdev); extern void r600_pm_init_profile(struct radeon_device *rdev);
......
...@@ -365,9 +365,9 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, ...@@ -365,9 +365,9 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
} }
robj = gem_to_radeon_bo(gobj); robj = gem_to_radeon_bo(gobj);
r = radeon_bo_wait(robj, NULL, false); r = radeon_bo_wait(robj, NULL, false);
/* callback hw specific functions if any */ /* Flush HDP cache via MMIO if necessary */
if (rdev->asic->ioctl_wait_idle) if (rdev->asic->mmio_hdp_flush)
robj->rdev->asic->ioctl_wait_idle(rdev, robj); robj->rdev->asic->mmio_hdp_flush(rdev);
drm_gem_object_unreference_unlocked(gobj); drm_gem_object_unreference_unlocked(gobj);
r = radeon_gem_handle_lockup(rdev, r); r = radeon_gem_handle_lockup(rdev, r);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment