From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Alex Deucher <alexander.deucher@amd.com>
Subject: [ 48/73] drm/radeon: update wait_for_vblank for r5xx-r7xx
Date: Thu, 9 May 2013 15:25:38 -0700 [thread overview]
Message-ID: <20130509222531.305346050@linuxfoundation.org> (raw)
In-Reply-To: <20130509222526.480204972@linuxfoundation.org>
3.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <alexander.deucher@amd.com>
commit bea5497bfc1067620c8c8e9d37a42e0bb6d7d7fa upstream.
Properly wait for the next vblank region. The previous
code didn't always wait long enough depending on the timing.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/radeon/rs600.c | 52 ++++++++++++++++++++++++++++++++++-------
1 file changed, 44 insertions(+), 8 deletions(-)
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -52,23 +52,59 @@ static const u32 crtc_offsets[2] =
AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL
};
+static bool avivo_is_in_vblank(struct radeon_device *rdev, int crtc)
+{
+ if (RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK)
+ return true;
+ else
+ return false;
+}
+
+static bool avivo_is_counter_moving(struct radeon_device *rdev, int crtc)
+{
+ u32 pos1, pos2;
+
+ pos1 = RREG32(AVIVO_D1CRTC_STATUS_POSITION + crtc_offsets[crtc]);
+ pos2 = RREG32(AVIVO_D1CRTC_STATUS_POSITION + crtc_offsets[crtc]);
+
+ if (pos1 != pos2)
+ return true;
+ else
+ return false;
+}
+
+/**
+ * avivo_wait_for_vblank - vblank wait asic callback.
+ *
+ * @rdev: radeon_device pointer
+ * @crtc: crtc to wait for vblank on
+ *
+ * Wait for vblank on the requested crtc (r5xx-r7xx).
+ */
void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc)
{
- int i;
+ unsigned i = 0;
if (crtc >= rdev->num_crtc)
return;
- if (RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[crtc]) & AVIVO_CRTC_EN) {
- for (i = 0; i < rdev->usec_timeout; i++) {
- if (!(RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK))
+ if (!(RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[crtc]) & AVIVO_CRTC_EN))
+ return;
+
+ /* depending on when we hit vblank, we may be close to active; if so,
+ * wait for another frame.
+ */
+ while (avivo_is_in_vblank(rdev, crtc)) {
+ if (i++ % 100 == 0) {
+ if (!avivo_is_counter_moving(rdev, crtc))
break;
- udelay(1);
}
- for (i = 0; i < rdev->usec_timeout; i++) {
- if (RREG32(AVIVO_D1CRTC_STATUS + crtc_offsets[crtc]) & AVIVO_D1CRTC_V_BLANK)
+ }
+
+ while (!avivo_is_in_vblank(rdev, crtc)) {
+ if (i++ % 100 == 0) {
+ if (!avivo_is_counter_moving(rdev, crtc))
break;
- udelay(1);
}
}
}
next prev parent reply other threads:[~2013-05-09 22:25 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 22:24 [ 00/73] 3.9.2-stable review Greg Kroah-Hartman
2013-05-09 22:24 ` [ 01/73] xen/arm: actually pass a non-NULL percpu pointer to request_percpu_irq Greg Kroah-Hartman
2013-05-09 22:24 ` [ 02/73] powerpc: Emulate non privileged DSCR read and write Greg Kroah-Hartman
2013-05-09 22:24 ` [ 03/73] powerpc/tm: Fix null pointer deference in flush_hash_page Greg Kroah-Hartman
2013-05-09 22:24 ` [ 04/73] powerpc: fix numa distance for form0 device tree Greg Kroah-Hartman
2013-05-09 22:24 ` [ 05/73] pwm: spear: Fix checking return value of clk_enable() and clk_prepare() Greg Kroah-Hartman
2013-05-09 22:24 ` [ 06/73] autofs - remove autofs dentry mount check Greg Kroah-Hartman
2013-05-09 22:24 ` [ 07/73] rpmsg: fix kconfig dependencies for VIRTIO Greg Kroah-Hartman
2013-05-09 22:24 ` [ 08/73] remoteproc: " Greg Kroah-Hartman
2013-05-09 22:24 ` [ 09/73] hugetlbfs: fix mmap failure in unaligned size request Greg Kroah-Hartman
2013-05-09 22:25 ` [ 10/73] iommu/amd: Properly initialize irq-table lock Greg Kroah-Hartman
2013-05-09 22:25 ` [ 11/73] menuconfig: Fix memory leak introduced by jump keys feature Greg Kroah-Hartman
2013-05-09 22:25 ` [ 12/73] net/eth/ibmveth: Fixup retrieval of MAC address Greg Kroah-Hartman
2013-05-09 22:25 ` [ 13/73] perf/x86/intel: Add support for IvyBridge model 58 Uncore Greg Kroah-Hartman
2013-05-09 22:25 ` [ 14/73] perf/x86/intel: Fix unintended variable name reuse Greg Kroah-Hartman
2013-05-09 22:25 ` [ 15/73] perf/x86: Blacklist all MEM_*_RETIRED events for Ivy Bridge Greg Kroah-Hartman
2013-05-09 22:25 ` [ 16/73] perf/x86/intel/lbr: Fix LBR filter Greg Kroah-Hartman
2013-05-09 22:25 ` [ 17/73] perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL Greg Kroah-Hartman
2013-05-09 22:25 ` [ 18/73] ipvs: ip_vs_sip_fill_param() BUG: bad check of return value Greg Kroah-Hartman
2013-05-09 22:25 ` [ 19/73] ext4: add check for inodes_count overflow in new resize ioctl Greg Kroah-Hartman
2013-05-09 22:25 ` [ 20/73] MODSIGN: do not send garbage to stderr when enabling modules signature Greg Kroah-Hartman
2013-05-09 22:25 ` [ 21/73] r8169: fix 8168evl frame padding Greg Kroah-Hartman
2013-05-09 22:25 ` [ 22/73] RDMA/cxgb4: Fix SQ allocation when on-chip SQ is disabled Greg Kroah-Hartman
2013-05-09 22:25 ` [ 23/73] arm64: Ignore the write ESR flag on cache maintenance faults Greg Kroah-Hartman
2013-05-09 22:25 ` [ 24/73] blkcg: fix "scheduling while atomic" in blk_queue_bypass_start Greg Kroah-Hartman
2013-05-09 22:25 ` [ 25/73] block: fix max discard sectors limit Greg Kroah-Hartman
2013-05-09 22:25 ` [ 26/73] drm/cirrus: deal with bo reserve fail in dirty update path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 27/73] drm/mgag200: " Greg Kroah-Hartman
2013-05-09 22:25 ` [ 28/73] drm/gma500: fix backlight hotkeys behaviour on netbooks Greg Kroah-Hartman
2013-05-09 22:25 ` [ 29/73] drm: prime: fix refcounting on the dmabuf import error path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 30/73] drm/prime: keep a reference from the handle to exported dma-buf (v6) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 31/73] drm/ast: deal with bo reserve fail in dirty update path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 32/73] drm/i915: Fix sdvo connector get_hw_state function Greg Kroah-Hartman
2013-05-09 22:25 ` [ 33/73] drm/i915: Add no-lvds quirk for Fujitsu Esprimo Q900 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 34/73] drm/i915: Fix SDVO connector and encoder get_hw_state functions Greg Kroah-Hartman
2013-05-09 22:25 ` [ 35/73] drm/i915: Workaround incoherence between fences and LLC across multiple CPUs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 36/73] drm/i915: Use MLC (l3$) for context objects Greg Kroah-Hartman
2013-05-09 22:25 ` [ 37/73] drm/i915: set CPT FDI RX polarity bits based on VBT Greg Kroah-Hartman
2013-05-09 22:25 ` [ 38/73] drm/i915: dont check inconsistent modeset state when force-restoring Greg Kroah-Hartman
2013-05-09 22:25 ` [ 39/73] drm/i915: ensure single initialization and cleanup of backlight device Greg Kroah-Hartman
2013-05-09 22:25 ` [ 40/73] drm/i915: dont intel_crt_init on any ULT machines Greg Kroah-Hartman
2013-05-09 22:25 ` [ 41/73] drm/i915: Fixup Oops in the pipe config computation Greg Kroah-Hartman
2013-05-09 22:25 ` [ 42/73] drm/i915: Fall back to bit banging mode for DVO transmitter detection Greg Kroah-Hartman
2013-05-09 22:25 ` [ 43/73] drm/i915: correct the calculation of first_pd_entry_in_global_pt Greg Kroah-Hartman
2013-05-09 22:25 ` [ 44/73] drm/radeon: dont use get_engine_clock() on APUs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 45/73] drm/radeon: use frac fb div on RS780/RS880 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 46/73] drm/radeon: fix typo in rv515_mc_resume() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 47/73] drm/radeon/dce6: add missing display reg for tiling setup Greg Kroah-Hartman
2013-05-09 22:25 ` Greg Kroah-Hartman [this message]
2013-05-09 22:25 ` [ 49/73] drm/radeon: update wait_for_vblank for evergreen+ Greg Kroah-Hartman
2013-05-09 22:25 ` [ 50/73] drm/radeon: properly lock disp in mc_stop/resume " Greg Kroah-Hartman
2013-05-09 22:25 ` [ 51/73] drm/radeon: properly lock disp in mc_stop/resume for r5xx-r7xx Greg Kroah-Hartman
2013-05-09 22:25 ` [ 52/73] drm/radeon: update wait_for_vblank for r1xx-r4xx Greg Kroah-Hartman
2013-05-09 22:25 ` [ 53/73] drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 54/73] drm/radeon: add some new SI PCI ids Greg Kroah-Hartman
2013-05-09 22:25 ` [ 55/73] drm/radeon/evergreen+: dont enable HPD interrupts on eDP/LVDS Greg Kroah-Hartman
2013-05-09 22:25 ` [ 56/73] drm/radeon: cleanup properly if mmio mapping fails Greg Kroah-Hartman
2013-05-09 22:25 ` [ 57/73] drm/radeon: fix hdmi mode enable on RS600/RS690/RS740 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 58/73] drm/radeon: fix typo in si_select_se_sh() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 59/73] drm/radeon: Always flush the VM Greg Kroah-Hartman
2013-05-09 22:25 ` [ 60/73] drm/radeon: disable the crtcs in mc_stop (r5xx-r7xx) (v2) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 61/73] drm/radeon: fix endian bugs in atom_allocate_fb_scratch() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 62/73] drm/radeon: fix possible segfault when parsing pm tables Greg Kroah-Hartman
2013-05-09 22:25 ` [ 63/73] drm/radeon: add new richland pci ids Greg Kroah-Hartman
2013-05-09 22:25 ` [ 64/73] drm/radeon: fix handling of v6 power tables Greg Kroah-Hartman
2013-05-09 22:25 ` [ 65/73] drm/tilcdc: Fix an incorrect condition Greg Kroah-Hartman
2013-05-09 22:25 ` [ 66/73] tracing: Fix ftrace_dump() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 67/73] Btrfs: compare relevant parts of delayed tree refs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 68/73] Btrfs: fix extent logging with O_DIRECT into prealloc Greg Kroah-Hartman
2013-05-09 22:25 ` [ 69/73] EDAC: Dont give write permission to read-only files Greg Kroah-Hartman
2013-05-09 22:26 ` [ 70/73] PCI: Delay final fixups until resources are assigned Greg Kroah-Hartman
2013-05-09 22:26 ` [ 71/73] qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card Greg Kroah-Hartman
2013-05-09 22:26 ` [ 72/73] NFSv4.x: Fix handling of partially delegated locks Greg Kroah-Hartman
2013-05-09 22:26 ` [ 73/73] kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees() Greg Kroah-Hartman
2013-05-10 15:23 ` [ 00/73] 3.9.2-stable review Shuah Khan
2013-05-10 15:28 ` Greg Kroah-Hartman
2013-05-11 5:26 ` Satoru Takeuchi
2013-05-11 13:53 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130509222531.305346050@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alexander.deucher@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox