From patchwork Sun Jul 27 21:41:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 4631481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BE5DC0338 for ; Sun, 27 Jul 2014 21:42:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8290E20131 for ; Sun, 27 Jul 2014 21:42:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3FBEB2012F for ; Sun, 27 Jul 2014 21:42:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D1AA6E391; Sun, 27 Jul 2014 14:42:02 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id A7AEB6E383 for ; Sun, 27 Jul 2014 14:41:53 -0700 (PDT) Received: by mail-wg0-f46.google.com with SMTP id m15so6499319wgh.5 for ; Sun, 27 Jul 2014 14:41:52 -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-type:content-transfer-encoding; bh=pLkUccjknJmrj9kwEMe2lkLDXWrWxghkdNlXVodAJUs=; b=i192QlfxWyF2kNUUNNTZYwf+bncv7uIwRvlkc6G2Nv5wkhy6DplDnfqI+j2fNbUJC4 8TkZjDBNGU92HbxVetpczy+b8XYA0wB1zqKW68gah7GJjBfn4MdwT1HpPDtJ0pzdR6+e bTuaiAsWfirSC/KeMtDuKWJ1jHVcq/JUQo1vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=pLkUccjknJmrj9kwEMe2lkLDXWrWxghkdNlXVodAJUs=; b=GpERiT+zuzbFNzaPZR8TTQcBL6Jdks+5d89e80g+V2HLqHZlL3ugP3f6dBX4sQuB4W /eFEDWb+L2SBQrtlKQB8blp46JQfwuPvIhFeCjQXTSPzbbMnxxT3v/OoixUlY44Ykxx0 swVV6P7BX6eHcNDYqPM5GzZHs5xklolHQc+1nB6oJOshNQa8VaLGgqfmquTfW319xuKY RMXudc13SxN8VDzg78JkdXQM+y+tbeda31eYbUqLaPzIHEiz7lJzg///xujXI0/rIK4j 9Ss5qos7xe8FcrBVlErnjWvhlYpFm8WZw/ELLbxBvma9XMJnXtGMm4L931/Rs+1Ge6PF nC0A== X-Gm-Message-State: ALoCoQk7xA1IF7EwEQysedMXiCKUhQYDDsm7dO7fw/YJELg2G3oeZVv5CJc61iYCiYkSdRvfSLv7 X-Received: by 10.180.107.65 with SMTP id ha1mr23886494wib.59.1406497312843; Sun, 27 Jul 2014 14:41:52 -0700 (PDT) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id di7sm44343171wjb.34.2014.07.27.14.41.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Jul 2014 14:41:52 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 07/19] drm: Add drm_crtc_vblank_waitqueue() Date: Sun, 27 Jul 2014 23:41:36 +0200 Message-Id: <1406497308-30733-8-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406497308-30733-1-git-send-email-daniel.vetter@ffwll.ch> References: <1406497308-30733-1-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Add a small static inline helper to grab the vblank wait queue based on the drm_crtc. This is useful for drivers to do internal vblank waits using wait_event() & co. v2: Pimp commit message (Daniel) Add kernel doc (Daniel) Suggested-by: Daniel Vetter Signed-off-by: Ville Syrjälä Signed-off-by: Daniel Vetter --- Documentation/DocBook/drm.tmpl | 1 + include/drm/drmP.h | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 1d3756d3176c..972759489376 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl @@ -3400,6 +3400,7 @@ void (*disable_vblank) (struct drm_device *dev, int crtc); Vertical Blanking and Interrupt Handling Functions Reference !Edrivers/gpu/drm/drm_irq.c +!Iinclude/drm/drmP.h drm_crtc_vblank_waitqueue diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 9b6a445f8602..06a673894c47 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1372,6 +1372,17 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, extern void drm_calc_timestamping_constants(struct drm_crtc *crtc, const struct drm_display_mode *mode); +/** + * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC + * @crtc: which CRTC's vblank waitqueue to retrieve + * + * This function returns a pointer to the vblank waitqueue for the CRTC. + * Drivers can use this to implement vblank waits using wait_event() & co. + */ +static inline wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc) +{ + return &crtc->dev->vblank[drm_crtc_index(crtc)].queue; +} /* Modesetting support */ extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);