From patchwork Fri Aug 29 10:12:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 4809911 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E8309F37E for ; Fri, 29 Aug 2014 10:13:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FC8D20127 for ; Fri, 29 Aug 2014 10:13:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B9BEE20123 for ; Fri, 29 Aug 2014 10:13:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BED7B6E6A3; Fri, 29 Aug 2014 03:13:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 9375B6E6A1 for ; Fri, 29 Aug 2014 03:13:42 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id n3so583773wiv.0 for ; Fri, 29 Aug 2014 03:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7FyUIi2TlTxy2youijNO4sDmZkkBXXwnFN0ACKWrDng=; b=ntiC4487bAtCcUn75TnGCNwXMiqoZjc6D8gI6XNqWFjJEcTyrGgZhkCLaXlyoLVQYr 4AORCi8dfVlwrQTrTY06vYxA++Z8nV4/Z1jg5OSlkY+fNTiZ98ExsDfTsTG5CAfweWZ/ ymCCwi3BC061c3DFJmgjviw5ArNr/3C0ydUwk/FmVqqXMFGkKX41wPGRnS3rYZANEiti PgD31Xbry6tD0HSfD3p6eAN7eP/qJX5JPt/0dhSJrt0kFbvnfoub+qrlSisLE+WcnPze 21Z4pTdd4wz1xJrgYFwLp1YS8LxmIqlk/Kw+TuvCkRpB9VFn+caV0RG4nfNLRoS8E94F q1dQ== X-Received: by 10.194.179.73 with SMTP id de9mr12160318wjc.87.1409307221888; Fri, 29 Aug 2014 03:13:41 -0700 (PDT) Received: from david-tp.localdomain (stgt-4d02e0c1.pool.mediaWays.net. [77.2.224.193]) by mx.google.com with ESMTPSA id la2sm17479347wjb.5.2014.08.29.03.13.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Aug 2014 03:13:41 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 13/20] drm: inline "struct drm_sigdata" Date: Fri, 29 Aug 2014 12:12:39 +0200 Message-Id: <1409307166-12396-14-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> References: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 The sigdata structure is only used to group two fields in drm_device. Inline it and make it an unnamed object. Signed-off-by: David Herrmann Reviewed-by: Thierry Reding --- drivers/gpu/drm/drm_lock.c | 15 ++++++++------- include/drm/drmP.h | 12 +++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index e26b59e..60f1481 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -120,7 +120,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) sigaddset(&dev->sigmask, SIGTTOU); dev->sigdata.context = lock->context; dev->sigdata.lock = master->lock.hw_lock; - block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); + block_all_signals(drm_notifier, dev, &dev->sigmask); } if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) @@ -286,26 +286,27 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context) * If the lock is not held, then let the signal proceed as usual. If the lock * is held, then set the contended flag and keep the signal blocked. * - * \param priv pointer to a drm_sigdata structure. + * \param priv pointer to a drm_device structure. * \return one if the signal should be delivered normally, or zero if the * signal should be blocked. */ static int drm_notifier(void *priv) { - struct drm_sigdata *s = (struct drm_sigdata *) priv; + struct drm_device *dev = priv; + struct drm_hw_lock *lock = dev->sigdata.lock; unsigned int old, new, prev; /* Allow signal delivery if lock isn't held */ - if (!s->lock || !_DRM_LOCK_IS_HELD(s->lock->lock) - || _DRM_LOCKING_CONTEXT(s->lock->lock) != s->context) + if (!lock || !_DRM_LOCK_IS_HELD(lock->lock) + || _DRM_LOCKING_CONTEXT(lock->lock) != dev->sigdata.context) return 1; /* Otherwise, set flag to force call to drmUnlock */ do { - old = s->lock->lock; + old = lock->lock; new = old | _DRM_LOCK_CONT; - prev = cmpxchg(&s->lock->lock, old, new); + prev = cmpxchg(&lock->lock, old, new); } while (prev != old); return 0; } diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8f55875..840a373 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -432,12 +432,6 @@ struct drm_sg_mem { dma_addr_t *busaddr; }; -struct drm_sigdata { - int context; - struct drm_hw_lock *lock; -}; - - /** * Kernel side of a mapping */ @@ -1035,9 +1029,13 @@ struct drm_device { struct drm_sg_mem *sg; /**< Scatter gather memory */ unsigned int num_crtcs; /**< Number of CRTCs on this device */ - struct drm_sigdata sigdata; /**< For block_all_signals */ sigset_t sigmask; + struct { + int context; + struct drm_hw_lock *lock; + } sigdata; + struct drm_local_map *agp_buffer_map; unsigned int agp_buffer_token;