From patchwork Mon Jul 9 08:40:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10513997 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 1B7B56032A for ; Mon, 9 Jul 2018 08:40:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0703428A77 for ; Mon, 9 Jul 2018 08:40:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF8DA28A73; Mon, 9 Jul 2018 08:40:31 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5BCA28A74 for ; Mon, 9 Jul 2018 08:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E171C6E3D9; Mon, 9 Jul 2018 08:40:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86A1E6E3CC for ; Mon, 9 Jul 2018 08:40:24 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id r17-v6so13269122edo.13 for ; Mon, 09 Jul 2018 01:40:24 -0700 (PDT) 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; bh=tDWu51drFztVKrQuRFJy2dS3Luqzk8Ha6bOn4sq4uj4=; b=IPsHswVU8snaL0YW10fzVPV+ZDBOQWy4IbnhrH8WAN2O0TqflNQzYu32rX8gUfe9TY ZE3OHDWEPuJFnGhyZY0tsTSZNsuIzHUxF+5Si+EUf1jU9WwcGW1+0hpfKe4TeorrU0aq K1LXrBOXnYQyPxftX3Nr00CguhQR17w9TVAv/TMEFyB3ft9VUBE9O7c4bvsNEZacbiX4 CPYJANDJe6FPBk/50cGke8YyN+XnJANYYoZK4wC5AcbPQ03Tg7QeEREN7//T/UvLELiE dlD/bfUyUOOBjjirTRpk4gN4OEbpvvEpALxGXqFjci3dAoVcw4KMF2OmI2xFYh1cUb1E cxzw== X-Gm-Message-State: APt69E1Ep5UMlXxkLbDySPdwuu91FOJKEEbG7sBB35ETPeeekzhjogLg KxaMOVYjkij2Vx0xCPE+UiDku+gn X-Google-Smtp-Source: AAOMgpdEXJbUUDSEo7rLM7SEUv4t3UpJ8iZY4pBo/ZP6IM2c8EidhUsu86xxhpgt24ugrYxkjjYEMw== X-Received: by 2002:aa7:c0c9:: with SMTP id j9-v6mr21617544edp.135.1531125622870; Mon, 09 Jul 2018 01:40:22 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id i12-v6sm8202954edf.26.2018.07.09.01.40.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 01:40:22 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 01/15] drm: move drv test macros out of drmP.h Date: Mon, 9 Jul 2018 10:40:02 +0200 Message-Id: <20180709084016.23750-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709084016.23750-1-daniel.vetter@ffwll.ch> References: <20180709084016.23750-1-daniel.vetter@ffwll.ch> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Daniel Vetter MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Last bit the prevented us from starting to delete the drmP.h monster includes from source files! Also add kernel-doc while moving them. A nice consistent drm_dev_ prefix would be cute for these, but since they're used everywhere I've figured I'll leave this bikeshed aside for now. Signed-off-by: Daniel Vetter Reviewed-by: Sean Paul --- include/drm/drmP.h | 19 ------------------- include/drm/drm_drv.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c5dfbdb7271d..f7a19c2a7a80 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -102,25 +102,6 @@ struct pci_controller; #define DRM_SWITCH_POWER_CHANGING 2 #define DRM_SWITCH_POWER_DYNAMIC_OFF 3 -static inline bool drm_core_check_feature(struct drm_device *dev, int feature) -{ - return dev->driver->driver_features & feature; -} - -/** - * drm_drv_uses_atomic_modeset - check if the driver implements - * atomic_commit() - * @dev: DRM device - * - * This check is useful if drivers do not have DRIVER_ATOMIC set but - * have atomic modesetting internally implemented. - */ -static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) -{ - return drm_core_check_feature(dev, DRIVER_ATOMIC) || - dev->mode_config.funcs->atomic_commit != NULL; -} - /* returns true if currently okay to sleep */ static inline bool drm_can_sleep(void) { diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 7e545f5f94d3..46a8009784df 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -649,6 +649,35 @@ static inline bool drm_dev_is_unplugged(struct drm_device *dev) return true; } +/** + * drm_core_check_feature - check driver feature flags + * @dev: DRM device to check + * @feature: feature flag + * + * This checks @dev for driver features, see &drm_driver.driver_features and the + * various DRIVER_\* flags. + * + * Returns true if the @feature is supported, false otherwise. + */ +static inline bool drm_core_check_feature(struct drm_device *dev, int feature) +{ + return dev->driver->driver_features & feature; +} + +/** + * drm_drv_uses_atomic_modeset - check if the driver implements + * atomic_commit() + * @dev: DRM device + * + * This check is useful if drivers do not have DRIVER_ATOMIC set but + * have atomic modesetting internally implemented. + */ +static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) +{ + return drm_core_check_feature(dev, DRIVER_ATOMIC) || + dev->mode_config.funcs->atomic_commit != NULL; +} + int drm_dev_set_unique(struct drm_device *dev, const char *name);