From patchwork Tue May 9 14:03:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9718003 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6AC9660364 for ; Tue, 9 May 2017 14:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FC5F28408 for ; Tue, 9 May 2017 14:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 544E528418; Tue, 9 May 2017 14:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8765283FE for ; Tue, 9 May 2017 14:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753782AbdEIODk (ORCPT ); Tue, 9 May 2017 10:03:40 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35770 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753546AbdEIODj (ORCPT ); Tue, 9 May 2017 10:03:39 -0400 Received: by mail-wr0-f194.google.com with SMTP id g12so337624wrg.2 for ; Tue, 09 May 2017 07:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qr0gpnTqdF20dFrI/lx/ot0L9sQgj0dW+nTLZx71fKg=; b=kTT89yYR9WqspIapQN/Q03xonc31TwMAIXwAqLnvPbwsTjqDmjpRZYwXK/4f8MsV0y FaqHruLYSLAapPdlJE3U3+HIwHb3CSrcj1CzZWAMilkkkK6qfzBeQtxv7QYxieOIvEE1 Ah+zK22t+z5Ij5oJlwW2fU/K5i1t2IN49S5yc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qr0gpnTqdF20dFrI/lx/ot0L9sQgj0dW+nTLZx71fKg=; b=tyMqHclbWCmq3pnBT+JwCTxJZT7b82OSN5YQ3LY0l3RxB4LAP7ITMMrw+R3mEqi9CK OfJSH3oiHzttd92cxsYdC57+1/9nTRhM11544c0M3S7pp9T2T+6qgOb8Mb5zib+2UI+4 LjQd2xr9BhexFW/XIYX704hwA7E2GPsaL2VImwxNylXG9boFpy2W6d8h0CoimvQCEvlF BhBhsibexYjNz+g2U572uR2jjJA68ggbBV6mav3kT8132JfZlPcR6f43M9XxvkF0J21o hipkHRHGUq6Upmf0L/p7AQAsbghqK8Kk3iR8m/MA02hy8AfxYXAL7AkoMPn7kra8/WwE FUHw== X-Gm-Message-State: AODbwcCEIiVTcu1maU7wh3tSG0qyVO9Gp8kpl4HBnFTh9AMOzi4Ij+aa 9mYh6MMYiUgeFA== X-Received: by 10.80.155.22 with SMTP id o22mr289435edi.28.1494338617470; Tue, 09 May 2017 07:03:37 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id m53sm63402edc.29.2017.05.09.07.03.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 07:03:36 -0700 (PDT) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , Daniel Vetter , Mario Kleiner , Eric Anholt , Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Ben Skeggs , Daniel Vetter Subject: [PATCH 2/5] drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp Date: Tue, 9 May 2017 16:03:26 +0200 Message-Id: <20170509140329.24114-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170509140329.24114-1-daniel.vetter@ffwll.ch> References: <20170509140329.24114-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's overkill to have a flag parameter which is essentially used just as a boolean. This takes care of core + adjusting drivers. Adjusting the scanout position callback is a bit harder, since radeon also supplies it's own driver-private flags in there. v2: Fixup misplaced hunks (Neil). v3: kbuild says v1 was better ... Cc: Mario Kleiner Cc: Eric Anholt Cc: Rob Clark Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: Alex Deucher Cc: Christian König Cc: Ben Skeggs Reviewed-by: Ville Syrjälä Reviewed-by: Neil Armstrong Signed-off-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 ++--- drivers/gpu/drm/drm_irq.c | 41 +++++++++++++++++-------------- drivers/gpu/drm/i915/i915_irq.c | 4 +-- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 4 +-- drivers/gpu/drm/nouveau/nouveau_display.c | 5 ++-- drivers/gpu/drm/nouveau/nouveau_display.h | 2 +- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_kms.c | 4 +-- drivers/gpu/drm/vc4/vc4_crtc.c | 4 +-- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- include/drm/drm_drv.h | 17 +++++++------ include/drm/drm_irq.h | 2 +- 13 files changed, 50 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 7b4f808afff9..0ce8292d97c0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1913,7 +1913,7 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); bool amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags); + bool in_vblank_irq); long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index a1b97809305e..babd969a63d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -941,7 +941,7 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe) * @crtc: crtc to get the timestamp for * @max_error: max error * @vblank_time: time value - * @flags: flags passed to the driver + * @in_vblank_irq: called from drm_handle_vblank() * * Gets the timestamp on the requested crtc based on the * scanout position. (all asics). @@ -950,7 +950,7 @@ void amdgpu_disable_vblank_kms(struct drm_device *dev, unsigned int pipe) bool amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags) + bool in_vblank_irq) { struct drm_crtc *crtc; struct amdgpu_device *adev = dev->dev_private; @@ -971,7 +971,7 @@ bool amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, /* Helper routine in DRM core does all the work: */ return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, - vblank_time, flags, + vblank_time, in_vblank_irq, &crtc->hwmode); } diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 677b37b0372b..fba6a842f4cd 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -54,7 +54,7 @@ static bool drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, - struct timeval *tvblank, unsigned flags); + struct timeval *tvblank, bool in_vblank_irq); static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ @@ -138,7 +138,7 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe */ do { cur_vblank = __get_vblank_counter(dev, pipe); - rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, 0); + rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, false); } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0); /* @@ -171,7 +171,7 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe * device vblank fields. */ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, - unsigned long flags) + bool in_vblank_irq) { struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; u32 cur_vblank, diff; @@ -194,7 +194,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, */ do { cur_vblank = __get_vblank_counter(dev, pipe); - rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, flags); + rc = drm_get_last_vbltimestamp(dev, pipe, &t_vblank, in_vblank_irq); } while (cur_vblank != __get_vblank_counter(dev, pipe) && --count > 0); if (dev->max_vblank_count != 0) { @@ -214,13 +214,13 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, */ diff = DIV_ROUND_CLOSEST_ULL(diff_ns, framedur_ns); - if (diff == 0 && flags & DRM_CALLED_FROM_VBLIRQ) + if (diff == 0 && in_vblank_irq) DRM_DEBUG_VBL("crtc %u: Redundant vblirq ignored." " diff_ns = %lld, framedur_ns = %d)\n", pipe, (long long) diff_ns, framedur_ns); } else { /* some kind of default for drivers w/o accurate vbl timestamping */ - diff = (flags & DRM_CALLED_FROM_VBLIRQ) != 0; + diff = in_vblank_irq ? 1 : 0; } /* @@ -253,7 +253,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, * Otherwise reinitialize delayed at next vblank interrupt and assign 0 * for now, to mark the vblanktimestamp as invalid. */ - if (!rc && (flags & DRM_CALLED_FROM_VBLIRQ) == 0) + if (!rc && in_vblank_irq) t_vblank = (struct timeval) {0, 0}; store_vblank(dev, pipe, diff, &t_vblank, cur_vblank); @@ -291,7 +291,7 @@ u32 drm_accurate_vblank_count(struct drm_crtc *crtc) spin_lock_irqsave(&dev->vblank_time_lock, flags); - drm_update_vblank_count(dev, pipe, 0); + drm_update_vblank_count(dev, pipe, false); vblank = drm_vblank_count(dev, pipe); spin_unlock_irqrestore(&dev->vblank_time_lock, flags); @@ -349,7 +349,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe) * this time. This makes the count account for the entire time * between drm_crtc_vblank_on() and drm_crtc_vblank_off(). */ - drm_update_vblank_count(dev, pipe, 0); + drm_update_vblank_count(dev, pipe, false); spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); } @@ -700,9 +700,10 @@ EXPORT_SYMBOL(drm_calc_timestamping_constants); * @max_error: Desired maximum allowable error in timestamps (nanosecs) * On return contains true maximum error of timestamp * @vblank_time: Pointer to struct timeval which should receive the timestamp - * @flags: Flags to pass to driver: - * 0 = Default, - * DRM_CALLED_FROM_VBLIRQ = If function is called from vbl IRQ handler + * @in_vblank_irq: + * True when called from drm_crtc_handle_vblank(). Some drivers + * need to apply some workarounds for gpu-specific vblank irq quirks + * if flag is set. * @mode: mode which defines the scanout timings * * Implements calculation of exact vblank timestamps from given drm_display_mode @@ -732,7 +733,7 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags, + bool in_vblank_irq, const struct drm_display_mode *mode) { struct timeval tv_etime; @@ -740,6 +741,7 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, unsigned int vbl_status; int vpos, hpos, i; int delta_ns, duration_ns; + unsigned flags = in_vblank_irq ? DRM_CALLED_FROM_VBLIRQ : 0; if (pipe >= dev->num_crtcs) { DRM_ERROR("Invalid crtc %u\n", pipe); @@ -843,9 +845,10 @@ static struct timeval get_drm_timestamp(void) * @dev: DRM device * @pipe: index of CRTC whose vblank timestamp to retrieve * @tvblank: Pointer to target struct timeval which should receive the timestamp - * @flags: Flags to pass to driver: - * 0 = Default, - * DRM_CALLED_FROM_VBLIRQ = If function is called from vbl IRQ handler + * @in_vblank_irq: + * True when called from drm_crtc_handle_vblank(). Some drivers + * need to apply some workarounds for gpu-specific vblank irq quirks + * if flag is set. * * Fetches the system timestamp corresponding to the time of the most recent * vblank interval on specified CRTC. May call into kms-driver to @@ -859,7 +862,7 @@ static struct timeval get_drm_timestamp(void) */ static bool drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, - struct timeval *tvblank, unsigned flags) + struct timeval *tvblank, bool in_vblank_irq) { bool ret = false; @@ -869,7 +872,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe, /* Query driver if possible and precision timestamping enabled. */ if (dev->driver->get_vblank_timestamp && (max_error > 0)) ret = dev->driver->get_vblank_timestamp(dev, pipe, &max_error, - tvblank, flags); + tvblank, in_vblank_irq); /* GPU high precision timestamp query unsupported or failed. * Return current monotonic/gettimeofday timestamp as best estimate. @@ -1747,7 +1750,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe) return false; } - drm_update_vblank_count(dev, pipe, DRM_CALLED_FROM_VBLIRQ); + drm_update_vblank_count(dev, pipe, true); spin_unlock(&dev->vblank_time_lock); diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 34cb05a59742..66e3e2ac7453 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -967,7 +967,7 @@ int intel_get_crtc_scanline(struct intel_crtc *crtc) static bool i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags) + bool in_vblank_irq) { struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc; @@ -991,7 +991,7 @@ static bool i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, /* Helper routine in DRM core does all the work: */ return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, - vblank_time, flags, + vblank_time, in_vblank_irq, &crtc->base.hwmode); } diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c index ffeb34bee3af..07e2b1335f65 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c @@ -595,7 +595,7 @@ static int mdp5_get_scanoutpos(struct drm_device *dev, unsigned int pipe, static bool mdp5_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags) + bool in_vblank_irq) { struct msm_drm_private *priv = dev->dev_private; struct drm_crtc *crtc; @@ -612,7 +612,7 @@ static bool mdp5_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe, } return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, - vblank_time, flags, + vblank_time, in_vblank_irq, &crtc->mode); } diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index f1e36f70755d..2d28ef57f2bf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -158,7 +158,7 @@ nouveau_display_scanoutpos(struct drm_device *dev, unsigned int pipe, bool nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, - int *max_error, struct timeval *time, unsigned flags) + int *max_error, struct timeval *time, bool in_vblank_irq) { struct drm_crtc *crtc; @@ -170,7 +170,8 @@ nouveau_display_vblstamp(struct drm_device *dev, unsigned int pipe, else mode = &crtc->hwmode; return drm_calc_vbltimestamp_from_scanoutpos(dev, - pipe, max_error, time, flags, mode); + pipe, max_error, time, in_vblank_irq, + mode); } } diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h index c6bfe533a641..8ec86259c5ac 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.h +++ b/drivers/gpu/drm/nouveau/nouveau_display.h @@ -72,7 +72,7 @@ int nouveau_display_scanoutpos(struct drm_device *, unsigned int, unsigned int, int *, int *, ktime_t *, ktime_t *, const struct drm_display_mode *); bool nouveau_display_vblstamp(struct drm_device *, unsigned int, int *, - struct timeval *, unsigned); + struct timeval *, bool); int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event, diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index caa0b1cc4269..88fc791ec8fb 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -118,7 +118,7 @@ void radeon_disable_vblank_kms(struct drm_device *dev, unsigned int pipe); bool radeon_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags); + bool in_vblank_irq); void radeon_driver_irq_preinstall_kms(struct drm_device *dev); int radeon_driver_irq_postinstall_kms(struct drm_device *dev); void radeon_driver_irq_uninstall_kms(struct drm_device *dev); diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 535969d74f64..5bccdeae0773 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -874,7 +874,7 @@ void radeon_disable_vblank_kms(struct drm_device *dev, int crtc) bool radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, int *max_error, struct timeval *vblank_time, - unsigned flags) + bool in_vblank_irq) { struct drm_crtc *drmcrtc; struct radeon_device *rdev = dev->dev_private; @@ -891,7 +891,7 @@ bool radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc, /* Helper routine in DRM core does all the work: */ return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, - vblank_time, flags, + vblank_time, in_vblank_irq, &drmcrtc->hwmode); } diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index f506525a1066..6ed53d2867c4 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -272,14 +272,14 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, bool vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, int *max_error, struct timeval *vblank_time, - unsigned flags) + bool in_vblank_irq) { struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id); struct drm_crtc_state *state = crtc->state; /* Helper routine in DRM core does all the work: */ return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc_id, max_error, - vblank_time, flags, + vblank_time, in_vblank_irq, &state->adjusted_mode); } diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index d1c53a5d0923..d192f7e5c1eb 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -495,7 +495,7 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, const struct drm_display_mode *mode); bool vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, int *max_error, struct timeval *vblank_time, - unsigned flags); + bool in_vblank_irq); /* vc4_debugfs.c */ int vc4_debugfs_init(struct drm_minor *minor); diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index da78e248d9d8..a97dbc1eeccd 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -241,8 +241,10 @@ struct drm_driver { * DRM device. * pipe: * Id of the crtc to query. - * flags: - * Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0). + * in_vblank_irq: + * True when called from drm_crtc_handle_vblank(). Some drivers + * need to apply some workarounds for gpu-specific vblank irq quirks + * if flag is set. * vpos: * Target location for current vertical scanout position. * hpos: @@ -308,11 +310,10 @@ struct drm_driver { * Returns true upper bound on error for timestamp. * vblank_time: * Target location for returned vblank timestamp. - * flags: - * 0 = Defaults, no special treatment needed. - * DRM_CALLED_FROM_VBLIRQ = Function is called from vblank - * irq handler. Some drivers need to apply some workarounds - * for gpu-specific vblank irq quirks if flag is set. + * in_vblank_irq: + * True when called from drm_crtc_handle_vblank(). Some drivers + * need to apply some workarounds for gpu-specific vblank irq quirks + * if flag is set. * * Returns: * @@ -322,7 +323,7 @@ struct drm_driver { bool (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags); + bool in_vblank_irq); /* these have to be filled in */ diff --git a/include/drm/drm_irq.h b/include/drm/drm_irq.h index f0d5ccf9b282..445406efb8dc 100644 --- a/include/drm/drm_irq.h +++ b/include/drm/drm_irq.h @@ -156,7 +156,7 @@ u32 drm_accurate_vblank_count(struct drm_crtc *crtc); bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, unsigned int pipe, int *max_error, struct timeval *vblank_time, - unsigned flags, + bool in_vblank_irq, const struct drm_display_mode *mode); void drm_calc_timestamping_constants(struct drm_crtc *crtc, const struct drm_display_mode *mode);