From patchwork Sat Jan 7 17:22:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40423 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385326wrt; Sat, 7 Jan 2023 09:25:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXuykZOLUiPZck1lub9A621M3+dO5C6nMdYRxT8Ftscb2M7EccP3fBAmnuXxsyWupnsJKXPg X-Received: by 2002:a05:6a20:2aa1:b0:9d:efbf:48bf with SMTP id v33-20020a056a202aa100b0009defbf48bfmr96365875pzh.3.1673112320973; Sat, 07 Jan 2023 09:25:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112320; cv=pass; d=google.com; s=arc-20160816; b=idA1MkZzjbZMCuvr7dtk5h2U2f1OqV+8otlfxcg/TmMHoCwohSpViU9QqorosgRFOu 6C6R9ZDhTGMUplK0wrFj+XxbbqCnj3Ns4SGdLHcvR0mYvDWSfNP6+h1DXKiOy9dPoQkh Fm7jKLjwWlM1rnJjoB8mnLFTw736TmmyeUiOAJRgFtDI/0VTznpRcuH96FfX37D1FcKV 3fwOrMSIBbF7vPBKN/1PNX09TpExET7fivcBrtOrWPiCDUTyKFTJg6LhveJVW2D2KU8n V27IXwp531wh/Vv+cEIzX9LXTevf+mrJpIVF7Z+Q2VVHdLWrjkn4wJ0smsnHO2KldsSa Rj0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=oEl/xNVpxWJFSYjiRvY2kh4s0zME1EsAb7YxIbJrwTE=; b=XVPMl95Nn8s+tFv0bulXpoJnlwpy+gRd2hDWEfuIqxRpLY6FqMesALezqy2xki3Yrn nA6VGZOZi94qqHVG2I/9OOA7jPr7O43Fq+ydKEnVR2V/8aYYvbah9tB3ylAu67pF2wr0 +6jod7bbFwgW2atewE9Gdl+OHbX6T+QqGnDuqgkyWoXa18t7TW1DrFBSBYPGJtUizji6 ZwDX2HhM3qidL0/3N/sO+z87ENSVb2SZ4Z2QpEdQJlkNG6ItrFFGzUQox5qnRRWJ8cN9 KNMrShRFFUZbLR26lcRKsmnybGQxef6LH3SliTJndjTJzmUGH/GSGYCi1WzEExR6VMtZ PBFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=bYgMUH7o; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a636b04000000b00476cb3a08fcsi4632677pgc.338.2023.01.07.09.25.08; Sat, 07 Jan 2023 09:25:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=bYgMUH7o; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233115AbjAGRYn (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232717AbjAGRXx (ORCPT ); Sat, 7 Jan 2023 12:23:53 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170B84D486 for ; Sat, 7 Jan 2023 09:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112188; cv=none; d=zohomail.in; s=zohoarc; b=S/8vKJ7WmLbq1uTxwvtDufuBQ3RUo3NqVYMJFnpvNi9J2W1HIRNL+LqtZa3o4lHxMx4UWiXgJg6eGmtzA1yyzEwExfVT6//d+IJ8+VESvxvWbG6+77utgTJNKsW3+3xxOIyke7NT5paSfMvmtdELzYPuDt+ge9iT/55/+jjl67Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112188; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=oEl/xNVpxWJFSYjiRvY2kh4s0zME1EsAb7YxIbJrwTE=; b=L9jsD8UX3RGdjK6kFpPoE/PxE0D8k1SM6nJHbOt7ue8PzHMfM7n1uN/iyOBmVdmQ48ZOcLGruQjOZ7amb0FJRj641lyxH9TDSxkjJBHDLmb+LlOpq2YOJD5MZhDDMspWtOp0fwMOAWHVihz4xJx0mu/SO4q2tvs9hNgJl6sG4i0= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112188; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=oEl/xNVpxWJFSYjiRvY2kh4s0zME1EsAb7YxIbJrwTE=; b=bYgMUH7oZV5d63BTvMfq2iibS6aXgszc7IRiqFIKsyGdgpJ/o/+7qV9Xosog8/53 llbVDbYQLYxxSHAZh2iVPuBSVk6wWoIDFSHJOT3Hb9RgXZCDz7qiDtajLH7aFzaNTOl 5R/mbzwZudg85Yn2RlS4S61mckXA8LZEc9gHWJE8= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112186326761.8380462490798; Sat, 7 Jan 2023 22:53:06 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: <625541825d76ae5ef0d82f4a0ce5c8976ceff9f0.1673110890.git.code@siddh.me> Subject: [PATCH v5 01/10] drm/print: Fix and add support for NULL as first argument in drm_* macros Date: Sat, 7 Jan 2023 22:52:21 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385424852101588?= X-GMAIL-MSGID: =?utf-8?q?1754385424852101588?= Comments say macros DRM_DEBUG_* are deprecated in favor of drm_dbg_*(NULL, ...), but they have broken support for it, as the macro will result in `(NULL) ? (NULL)->dev : NULL`. Thus, fix them by separating logic to get dev ptr in a new function, which will return the dev ptr if arg is not NULL. Use it in drm_dbg_*, and also in __DRM_DEFINE_DBG_RATELIMITED, where a similar (but correct) NULL check was in place. Also, add support for NULL in __drm_printk, so that all the drm_* macros will hence support NULL as the first argument. This also means that deprecation comments mentioning pr_()* can now be changed to the drm equivalents. There is a need to support device pointers, as in some cases, we may not have drm_device but just the device ptr, such as when dealing with struct mipi_dsi_host. Before this change, passing just mipi_dsi_host would have worked, since due to preprocessing, the resultant would be "host->dev", but now due to NULL check that cannot happen. Signed-off-by: Siddh Raman Pant --- include/drm/drm_print.h | 109 +++++++++++++++++++++++++++++----------- 1 file changed, 81 insertions(+), 28 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a44fb7ef257f..69ed1d256713 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -34,6 +34,7 @@ #include #include +#include /* Do *not* use outside of drm_print.[ch]! */ extern unsigned long __drm_debug; @@ -451,9 +452,60 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, * Prefer drm_device based logging over device or prink based logging. */ -/* Helper for struct drm_device based logging. */ +/** + * __drm_dev_ptr - Helper function to get drm->dev pointer. + * @drm: struct drm_device pointer. + * + * RETURNS: + * The struct device pointer (NULL if @drm is NULL). + */ +static inline struct device *__drm_dev_ptr(const struct drm_device *drm) +{ + if (drm) + return drm->dev; + + return NULL; +} + +/** + * __dev_ptr - Helper function to get the same device pointer. + * @ptr: struct device pointer, or NULL. + * + * RETURNS: + * The struct device pointer (NULL if @ptr is NULL). + */ +static inline struct device *__dev_ptr(const void *ptr) +{ + return (struct device *)ptr; +} + +/** + * __get_dev_ptr - Helper to get device pointer given struct drm_device *, + * or struct device *, or NULL. + * + * Primarily for use in drm_*() print macros, since they need to handle NULL + * as the first argument passed. + */ +#define __get_dev_ptr(drm) \ + _Generic((drm), \ + struct drm_device * : \ + __drm_dev_ptr, \ + default : \ + __dev_ptr \ + )(drm) + +/** + * Helper for struct drm_device based logging (prefer this over struct device). + * Also supports struct device ptr as an argument for edge cases. + */ #define __drm_printk(drm, level, type, fmt, ...) \ - dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) +({ \ + struct device *__dev_ = __get_dev_ptr(drm); \ + if (__dev_) \ + dev_##level##type(__dev_, "[drm] " fmt, ##__VA_ARGS__); \ + else \ + pr_##level##type("[drm] " fmt, ##__VA_ARGS__); \ +}) #define drm_info(drm, fmt, ...) \ @@ -487,25 +539,25 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev, #define drm_dbg_core(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_CORE, fmt, ##__VA_ARGS__) -#define drm_dbg_driver(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DRIVER, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_CORE, fmt, ##__VA_ARGS__) +#define drm_dbg_driver(drm, fmt, ...) \ + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_DRIVER, fmt, ##__VA_ARGS__) #define drm_dbg_kms(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_KMS, fmt, ##__VA_ARGS__) #define drm_dbg_prime(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_PRIME, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_PRIME, fmt, ##__VA_ARGS__) #define drm_dbg_atomic(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_ATOMIC, fmt, ##__VA_ARGS__) #define drm_dbg_vbl(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_VBL, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_VBL, fmt, ##__VA_ARGS__) #define drm_dbg_state(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_STATE, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_STATE, fmt, ##__VA_ARGS__) #define drm_dbg_lease(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_LEASE, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_LEASE, fmt, ##__VA_ARGS__) #define drm_dbg_dp(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DP, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_DP, fmt, ##__VA_ARGS__) #define drm_dbg_drmres(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_DRMRES, fmt, ##__VA_ARGS__) + drm_dev_dbg(__get_dev_ptr(drm), DRM_UT_DRMRES, fmt, ##__VA_ARGS__) #define drm_dbg(drm, fmt, ...) drm_dbg_driver(drm, fmt, ##__VA_ARGS__) @@ -533,31 +585,31 @@ void __drm_err(const char *format, ...); #define _DRM_PRINTK(once, level, fmt, ...) \ printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_info(). */ +/* NOTE: this is deprecated in favor of drm_info(NULL, ...). */ #define DRM_INFO(fmt, ...) \ _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_notice(). */ +/* NOTE: this is deprecated in favor of drm_notice(NULL, ...). */ #define DRM_NOTE(fmt, ...) \ _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_warn(). */ +/* NOTE: this is deprecated in favor of drm_warn(NULL, ...). */ #define DRM_WARN(fmt, ...) \ _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_info_once(). */ +/* NOTE: this is deprecated in favor of drm_info_once(NULL, ...). */ #define DRM_INFO_ONCE(fmt, ...) \ _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_notice_once(). */ +/* NOTE: this is deprecated in favor of drm_notice_once(NULL, ...). */ #define DRM_NOTE_ONCE(fmt, ...) \ _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_warn_once(). */ +/* NOTE: this is deprecated in favor of drm_warn_once(NULL, ...). */ #define DRM_WARN_ONCE(fmt, ...) \ _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_err(). */ +/* NOTE: this is deprecated in favor of drm_err(NULL, ...). */ #define DRM_ERROR(fmt, ...) \ __drm_err(fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of pr_err_ratelimited(). */ +/* NOTE: this is deprecated in favor of drm_err_ratelimited(NULL, ...). */ #define DRM_ERROR_RATELIMITED(fmt, ...) \ DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__) @@ -593,13 +645,14 @@ void __drm_err(const char *format, ...); #define DRM_DEBUG_DP(fmt, ...) \ __drm_dbg(DRM_UT_DP, fmt, ## __VA_ARGS__) -#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \ -({ \ - static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);\ - const struct drm_device *drm_ = (drm); \ - \ - if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_)) \ - drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## __VA_ARGS__); \ +#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) \ +({ \ + static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, \ + DEFAULT_RATELIMIT_BURST); \ + \ + if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_))\ + drm_dev_printk(__get_dev_ptr(drm), KERN_DEBUG, \ + fmt, ## __VA_ARGS__); \ }) #define drm_dbg_kms_ratelimited(drm, fmt, ...) \ From patchwork Sat Jan 7 17:22:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385214wrt; Sat, 7 Jan 2023 09:25:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsDP7yhgkyxFZhhbfQ2ZjFJzVQbKs2ZcL8yaEEf0v5IJbKfG26CXG5turxqIaTKo6Ai1YKE X-Received: by 2002:a17:90a:e513:b0:225:fb71:efc1 with SMTP id t19-20020a17090ae51300b00225fb71efc1mr42490242pjy.0.1673112308849; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=exQEnGg1Dtl8xeAs2QDzUqDIaV448YKaZhctyqdYJRIhPaGXmEnaM1oFQ/JgIaM7le k8D9DL1dtBPlxR+kIH9rM9BzKM6nUazLkj8UADdfm1/yKZ0DP209b5/vgNZCtW7Fu6j4 3OfvMVIRCROCq7NDcJTIe/pLSZb4wRvYCC7+My5cfboSRPIlKm7uisyn+wWJlnO6lqdy L+U3r3QalVvrAzX5KPn/qY4/NvFI5KlxxvKPxEyZoH1neTg6cHCzgUMppBS/fw4MNHHH pSQHvIAay3cufZ3fWV/4/PMmkNDBBJnhUbO+6I8ww9ZmbMJeQhiEiF8MDgSvewwvp3yY ViTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=VW9hDvdQvmrywMGmm3H1XxeS69NxAB0tGZp/9RrK+jk=; b=D70xzwpfsX+LQklAPZK89d9HWbQiNWOrhsZ8dunf6ms2IErOD7aLj9i6l5WewX5K/z NpQHNmh85AxoeaQv7q8rsgatl5isXT+atYISWGgoDg1yPmr5vSa/NNU+ekGCUl0fK6wj EIojkSSwfV6alQUrUHr+/Ka6EfYFdz4ljD054pMLtOdqe5F4+0ffW4Oc07V9AUg0KU+B EvX3SjNlFAiMVKgr1Eo+xVwAQC4leFYDEhjhbF3pcBdscRuOEx5YDDNlsEZB3avEo4Hh BSme0sqItH1FvFa9CUfhhZWzJEb++2mPVgPTdmvW8Q+1EMKC3ie385frqCKXydxqwPEt DXBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=ll7L8VPq; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn10-20020a17090b38ca00b00223bc9f1731si2640521pjb.170.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=ll7L8VPq; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232927AbjAGRYk (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232633AbjAGRXv (ORCPT ); Sat, 7 Jan 2023 12:23:51 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3A5F4D4AA for ; Sat, 7 Jan 2023 09:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112188; cv=none; d=zohomail.in; s=zohoarc; b=SivSZQLjl5HJnIif9ggtEE5FpQL+inwRFO8iCArUKL0eilrfA+gr0uBJFcJi+9mDXy9MGxhWh/Nfwwr+LWXOelMIJEK4+NWD8eDt/4G0obM6z/H6bBYKyKXYDd+8xIDsf4gLS/IP200NwDpZrKU/Nac1ExWZxADwcFHBhHXLG3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112188; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=VW9hDvdQvmrywMGmm3H1XxeS69NxAB0tGZp/9RrK+jk=; b=fADGnVEuMsHgAdKDLw7sjIzHU5wSa9i5x5zUE3BrqhpVHQeHR6NzVbI3JpqvEONRQ51xasBkIpetA/QF+FxK+GaIFXvUfnMFGTnnoCmJ+UPvis5Z6YjZGuYdgmv222JX58WwiXR7AauoxqrWZoLGHlEXO4X3b63Mh5CohC3QDfM= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112188; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=VW9hDvdQvmrywMGmm3H1XxeS69NxAB0tGZp/9RrK+jk=; b=ll7L8VPqjcwjLRgSmVjrWUfFSuq2oygkQ9/tw2KcPFPARnAWoWUBuIuTtnWsKhaR bnT45ZY8NpGvw4uE3yU9EAg+CJEgUgaSaGPBESCQYULMmTGJDtfG7Vzi831W59udWdA p/1j3sgjKrgD8cIBFEJC+DFaidqw8Qn9diUZ/zV8= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 167311218678056.52550845501207; Sat, 7 Jan 2023 22:53:06 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v5 02/10] drm: Remove usage of deprecated DRM_INFO Date: Sat, 7 Jan 2023 22:52:22 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385412748280526?= X-GMAIL-MSGID: =?utf-8?q?1754385412748280526?= drm_print.h says DRM_INFO is deprecated in favor of drm_info(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_client_modeset.c | 2 +- drivers/gpu/drm/drm_connector.c | 7 ++++--- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_pci.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 1b12a3c201a3..ae19734974b5 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -331,7 +331,7 @@ static bool drm_client_target_cloned(struct drm_device *dev, DRM_DEBUG_KMS("can clone using 1024x768\n"); return true; } - DRM_INFO("kms: can't enable cloning when we probably wanted to.\n"); + drm_info(dev, "kms: can't enable cloning when we probably wanted to.\n"); return false; } diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 8d92777e57dd..6e962ad565db 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -165,13 +165,14 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector) return; if (mode->force) { - DRM_INFO("forcing %s connector %s\n", connector->name, - drm_get_connector_force_name(mode->force)); + drm_info(connector->dev, "forcing %s connector %s\n", + connector->name, drm_get_connector_force_name(mode->force)); connector->force = mode->force; } if (mode->panel_orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN) { - DRM_INFO("cmdline forces connector %s panel_orientation to %d\n", + drm_info(connector->dev, + "cmdline forces connector %s panel_orientation to %d\n", connector->name, mode->panel_orientation); drm_connector_set_panel_orientation(connector, mode->panel_orientation); diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 11748dd513c3..dfb73c9d7930 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -901,7 +901,7 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) if (drm_core_check_feature(dev, DRIVER_MODESET)) drm_modeset_register_all(dev); - DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", + drm_info(dev, "Initialized %s %d.%d.%d %s for %s on minor %d\n", driver->name, driver->major, driver->minor, driver->patchlevel, driver->date, dev->dev ? dev_name(dev->dev) : "virtual device", diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 39d35fc3a43b..7dfb837d1325 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -262,7 +262,7 @@ void drm_legacy_pci_exit(const struct drm_driver *driver, } mutex_unlock(&legacy_dev_list_lock); } - DRM_INFO("Module unloaded\n"); + drm_info(NULL, "Module unloaded\n"); } EXPORT_SYMBOL(drm_legacy_pci_exit); From patchwork Sat Jan 7 17:22:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385209wrt; Sat, 7 Jan 2023 09:25:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXsaTlyC+15Dxr8+Kizd3gpH9p366FAQlTBg9mHwAXydPqxASP+50J30IyfCrftHI6dA2RUB X-Received: by 2002:a05:6a20:d2c6:b0:af:7233:5bfc with SMTP id ir6-20020a056a20d2c600b000af72335bfcmr90074271pzb.8.1673112308288; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=wRBpsh1CvUoY3piuGDxk3RRPMK21O7MH9EIB0X1Xw1I1HoLS00JmCqugeS+GIdy4fz 1KHruyb/TZp0us3xXpBf4CLCv9AMRuhJiYMZ+sFNE9FqWLA6NelvLfL+qBiMiWo9xiXw wr3YrHJOHZC2OeCCBgDw5RIMqdUlcH5ZDdq1oqSnErMHZ2IPQA2frr9fSx1XmXLWdCz3 +pxOXm4txIaeFCiCF7UAGddEi5j8Vb7IgWMzT+q0ouu5QjYp7OzmMwabqaOZSlH5mipp NSPahPC0OUWbCne0ZvRiWzhujPLYYmDnAczHcIjc1FcpVQP8RlEtnpUG9XRFspP6lbg0 4ClQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=8m3UiIpaqwhxOnubafQnfgDXsOIquhP+SlU1ixmnv+8=; b=hAzvL293jydS1JO7Kzw7JyXAeGoHUe8tt9h8scIou1F0X6T+SgYwP73Kod5Bi42JrR NnScrVqyioD9QZEKPbuuglIDHrD9U5qBuG5QZk6cksYCID1LJ7kbxY/BJof9Npx2j+59 QYddO+45WbYMhKH6eQHpYDpQOGmhOgi6XTUZAyuBMQ0solP3sWUvTQSaaH7T/18PLbqo 4O18HIY78njYoodIy+J+W947f/i9jBhf09mMXlT94emMsC1CAaGN4ClpQ7b4B0zc0EwJ x5W+QEfp+qDBg0NnEKrMb+NbuVI2CYRj5uHh6WDmUgoBq1Qma5h9EIg0U34HkLDcA0mu jfgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="fK6jVro/"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a63cf49000000b004a7a73eb62esi4841470pgj.100.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="fK6jVro/"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbjAGRXy (ORCPT + 99 others); Sat, 7 Jan 2023 12:23:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232665AbjAGRXp (ORCPT ); Sat, 7 Jan 2023 12:23:45 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 303A64D48F for ; Sat, 7 Jan 2023 09:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112188; cv=none; d=zohomail.in; s=zohoarc; b=ADOBnuoNuboAO5qFUiRQVwiOPmzuH7NSUrUkf6RfUXxPF1Uh2idrWL8RJkLfvJB7GywDCNNJJA7HDmVCUxYj2RyauMIsUiMTx7nMMJOSGc/1fQUbouPF/JWXUuNC7aUsOqQ1k9CqCYkrvqourSy/UhNVnaaXKkWC+EMECc1P2fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112188; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=8m3UiIpaqwhxOnubafQnfgDXsOIquhP+SlU1ixmnv+8=; b=VW07aaJ0CSsYIgsKxoWfC/hrh4RBcksYFZSxXTb9z95LoCSC/9fklWtAK15kqODW1YYiGsvG9gZ3X8p7K24g0pfEFR48piz4JG2IAXyQEqoUE+c/03yKjHhH+QRu0UIwGpaSUyJ+HWcUZe+dI8VfUMxBlj7hj7x1YttS1lDnXqc= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112188; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=8m3UiIpaqwhxOnubafQnfgDXsOIquhP+SlU1ixmnv+8=; b=fK6jVro/3CoNSHLecTeU043EVQbW6b1NRvDHmV1o2XZSjvf828YQkDKlqPxWznAM izcvoXDw7kxcunlXIwAve4gondMVJltcyqiL9FO/83kkeJwUadH6uDfEdmnE/hP2qwp ObgkqtKJC64HtRB2pfFbPADst0CsA02vBaQPtN70= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112187213332.966291569277; Sat, 7 Jan 2023 22:53:07 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: <0efc3a499d140c8ba134fe23de9afb82b71cf150.1673110890.git.code@siddh.me> Subject: [PATCH v5 03/10] drm: Remove usage of deprecated DRM_NOTE Date: Sat, 7 Jan 2023 22:52:23 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385411726278342?= X-GMAIL-MSGID: =?utf-8?q?1754385411726278342?= drm_print.h says DRM_NOTE is deprecated in favor of drm_notice(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_displayid.c | 2 +- drivers/gpu/drm/drm_kms_helper_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_displayid.c b/drivers/gpu/drm/drm_displayid.c index 38ea8203df45..67fed6cee9e9 100644 --- a/drivers/gpu/drm/drm_displayid.c +++ b/drivers/gpu/drm/drm_displayid.c @@ -26,7 +26,7 @@ static int validate_displayid(const u8 *displayid, int length, int idx) for (i = 0; i < dispid_length; i++) csum += displayid[idx + i]; if (csum) { - DRM_NOTE("DisplayID checksum invalid, remainder is %d\n", csum); + drm_notice(NULL, "DisplayID checksum invalid, remainder is %d\n", csum); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c index 0bf0fc1abf54..7a41373b67dc 100644 --- a/drivers/gpu/drm/drm_kms_helper_common.c +++ b/drivers/gpu/drm/drm_kms_helper_common.c @@ -41,7 +41,7 @@ MODULE_LICENSE("GPL and additional rights"); /* Backward compatibility for drm_kms_helper.edid_firmware */ static int edid_firmware_set(const char *val, const struct kernel_param *kp) { - DRM_NOTE("drm_kms_helper.edid_firmware is deprecated, please use drm.edid_firmware instead.\n"); + drm_notice(NULL, "drm_kms_helper.edid_firmware is deprecated, please use drm.edid_firmware instead.\n"); return __drm_set_edid_firmware_path(val); } From patchwork Sat Jan 7 17:22:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40422 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385216wrt; Sat, 7 Jan 2023 09:25:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXtnEjUNhDzRFtS5WvpTak2oTR6/gv9G9e1ppFqqbCOipyqw5PqPciMaPkjSggAvX5qsfhjX X-Received: by 2002:a17:902:ab8d:b0:192:f45d:92b9 with SMTP id f13-20020a170902ab8d00b00192f45d92b9mr11352939plr.29.1673112308950; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=dw+8uGgR3aOcge2RlR+OZqTWn+BjLxHu2GqgF1dfmwE1u3tH60LgWgkjbrSVb7uUCu SPX2CXyfEiBIXf9CH9V2jqKVpWVQTObYwUiTyajKbUZS/lYUX1cnPYfQJZ4ebK/xDjRx GoeyJ0tL0oBMAQSmHk9wUFBsU4KPtGOUmkAGMinXxN6p4Mqp7Jr0nZdlRUvotjrizj6L zOPQ2d40Wqlexz+32+Y3vsDvpPlMjO2z8IIo4v7aPnKvdOGOPhPUopioe6jXdZX8y7k3 9yecdUTTOUq5MBDmOLbR6p+wUMyjZUB5r8QMEIlerJi0Tzs+HpzozkBlU7pR3yX/Ey4g ynLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=UMuV6N5ad2BLIywmxVIu/mUwDO3vqGNE2mvnZQIP2+1Yn1ojDP325qfc3AVrAEqNYk 8bfusOCmQLmyh+jTjiRm5C8tEs95ETdzCFR5Rj1/XvRXgxeovJb9G/VQZG31KHO2H2re g+h3ZkrzP+bOD2jd/QZbmKq2XVfCZZXQd1TpwhCN+HhRUItPrONbLRqRZl0SscF2+Etw Y8LESfXSkM644kTKRgjadP1jaPQH6Jq+IRzrSTFM7+h3e/wlxodCgDj0/kRAi6hzDP54 WGCKK8TwszAT5QYV26SJPL1v3UJg1j+1v5vnFwZ0kqxgHDhG9IjeVismmgJRSAetFDWE VYPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="X/ITyW3d"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a656897000000b00478c967a88bsi1228724pgt.379.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="X/ITyW3d"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbjAGRY0 (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbjAGRXu (ORCPT ); Sat, 7 Jan 2023 12:23:50 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74CF74D73A for ; Sat, 7 Jan 2023 09:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112189; cv=none; d=zohomail.in; s=zohoarc; b=Z7bQ8wXuUqTwNkY1AL0zZVXcgs48DTP2BoeYSLLys7RT1V1rrH6HBjfy/0nfZykOD2qkAKE1wlZyutbUY0JetC6IlM28cRbpB28hYxTru916NzsBs1BP7yA/9bix7g9tnrCQJBu2v0fdmbFMhNoIsFCi+Vzyv/PDar65XmvIzSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112189; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=DWHAETtM+NFerdqHtCGJzYmfatkTB0eH6EasaZP15uIH8T0OBZa7FFH4GOZKGuwPMidWGtZxMARlHSPin3VMmJ7xd7iujtP7gpe+320DvQdNELml10tvArGSrAvJyZC4nHpuLUksO7zOiuoDkDrM/BJnhi4HHT060FqJioWWmVk= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112189; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=119OUosozo0U9mtWLJCKg4RIyTCQ7g7wNaZd1HAHXqM=; b=X/ITyW3dgNi02SEounY9+19MjuukuDqjpMeN7/Rf8+Lqy8lYbh2cVylCfrc8Q1Gm QfLk5J08slCdWCFUBGUm5QitFbt/e7J87sGAuQuAWrFukNRqqcjyxyeiFmrick3njty hoteZHCoBLBlpkC8kWllLugKfnJtf8KZApsLu368= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112187699524.0762038766127; Sat, 7 Jan 2023 22:53:07 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v5 04/10] drm: Remove usage of deprecated DRM_ERROR Date: Sat, 7 Jan 2023 22:52:24 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385412326889944?= X-GMAIL-MSGID: =?utf-8?q?1754385412326889944?= drm_print.h says DRM_ERROR is deprecated in favor of drm_err(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_bridge.c | 8 ++++---- drivers/gpu/drm/drm_bufs.c | 8 ++++---- drivers/gpu/drm/drm_client_modeset.c | 4 ++-- drivers/gpu/drm/drm_context.c | 4 ++-- drivers/gpu/drm/drm_crtc_helper.c | 8 ++++---- drivers/gpu/drm/drm_debugfs_crc.c | 3 ++- drivers/gpu/drm/drm_drv.c | 14 +++++++------- drivers/gpu/drm/drm_flip_work.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 3 ++- drivers/gpu/drm/drm_gem.c | 2 +- drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- drivers/gpu/drm/drm_hashtab.c | 4 ++-- drivers/gpu/drm/drm_lock.c | 16 ++++++++-------- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- drivers/gpu/drm/drm_mipi_dsi.c | 12 ++++++------ drivers/gpu/drm/drm_mm.c | 8 ++++---- drivers/gpu/drm/drm_mode_config.c | 2 +- drivers/gpu/drm/drm_modes.c | 26 +++++++++++++------------- drivers/gpu/drm/drm_modeset_helper.c | 2 +- drivers/gpu/drm/drm_plane.c | 2 +- drivers/gpu/drm/drm_scatter.c | 9 +++++---- drivers/gpu/drm/drm_vm.c | 2 +- 22 files changed, 73 insertions(+), 70 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c3d69af02e79..3d27f08db74d 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -351,11 +351,11 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, list_del(&bridge->chain_node); #ifdef CONFIG_OF - DRM_ERROR("failed to attach bridge %pOF to encoder %s: %d\n", - bridge->of_node, encoder->name, ret); + drm_err(encoder->dev, "failed to attach bridge %pOF to encoder %s: %d\n", + bridge->of_node, encoder->name, ret); #else - DRM_ERROR("failed to attach bridge to encoder %s: %d\n", - encoder->name, ret); + drm_err(encoder->dev, "failed to attach bridge to encoder %s: %d\n", + encoder->name, ret); #endif return ret; diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index fcca21e8efac..98aaf3379a3b 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -1474,15 +1474,15 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data, if (copy_from_user(&idx, &request->list[i], sizeof(idx))) return -EFAULT; if (idx < 0 || idx >= dma->buf_count) { - DRM_ERROR("Index %d (of %d max)\n", - idx, dma->buf_count - 1); + drm_err(dev, "Index %d (of %d max)\n", + idx, dma->buf_count - 1); return -EINVAL; } idx = array_index_nospec(idx, dma->buf_count); buf = dma->buflist[idx]; if (buf->file_priv != file_priv) { - DRM_ERROR("Process %d freeing buffer not owned\n", - task_pid_nr(current)); + drm_err(dev, "Process %d freeing buffer not owned\n", + task_pid_nr(current)); return -EINVAL; } drm_legacy_free_buffer(dev, buf); diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index ae19734974b5..e2403b8c6347 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -808,7 +808,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, offsets = kcalloc(connector_count, sizeof(*offsets), GFP_KERNEL); enabled = kcalloc(connector_count, sizeof(bool), GFP_KERNEL); if (!crtcs || !modes || !enabled || !offsets) { - DRM_ERROR("Memory allocation failed\n"); + drm_err(client->dev, "Memory allocation failed\n"); ret = -ENOMEM; goto out; } @@ -832,7 +832,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, offsets, enabled, width, height) && !drm_client_target_preferred(connectors, connector_count, modes, offsets, enabled, width, height)) - DRM_ERROR("Unable to find initial modes\n"); + drm_err(client->dev, "Unable to find initial modes\n"); DRM_DEBUG_KMS("picking CRTCs for %dx%d config\n", width, height); diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index c6e6a3e7219a..f6d68fad8311 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c @@ -276,7 +276,7 @@ int drm_legacy_setsareactx(struct drm_device *dev, void *data, static int drm_context_switch(struct drm_device * dev, int old, int new) { if (test_and_set_bit(0, &dev->context_flag)) { - DRM_ERROR("Reentering -- FIXME\n"); + drm_err(dev, "Reentering -- FIXME\n"); return -EBUSY; } @@ -307,7 +307,7 @@ static int drm_context_switch_complete(struct drm_device *dev, dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ if (!_DRM_LOCK_IS_HELD(file_priv->master->lock.hw_lock->lock)) { - DRM_ERROR("Lock isn't held after context switch\n"); + drm_err(dev, "Lock isn't held after context switch\n"); } /* If a context switch is ever initiated diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index a209659a996c..b74b4301a471 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -768,8 +768,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (!drm_crtc_helper_set_mode(set->crtc, set->mode, set->x, set->y, save_set.fb)) { - DRM_ERROR("failed to set mode on [CRTC:%d:%s]\n", - set->crtc->base.id, set->crtc->name); + drm_err(dev, "failed to set mode on [CRTC:%d:%s]\n", + set->crtc->base.id, set->crtc->name); set->crtc->primary->fb = save_set.fb; ret = -EINVAL; goto fail; @@ -826,7 +826,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (mode_changed && !drm_crtc_helper_set_mode(save_set.crtc, save_set.mode, save_set.x, save_set.y, save_set.fb)) - DRM_ERROR("failed to restore config after modeset failure\n"); + drm_err(dev, "failed to restore config after modeset failure\n"); kfree(save_connector_encoders); kfree(save_encoder_crtcs); @@ -996,7 +996,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev) /* Restoring the old config should never fail! */ if (ret == false) - DRM_ERROR("failed to set mode on crtc %p\n", crtc); + drm_err(dev, "failed to set mode on crtc %p\n", crtc); /* Turn off outputs that were already powered off */ if (drm_helper_choose_crtc_dpms(crtc)) { diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index bbc3bc4ba844..a59ef3f0e4a1 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -416,7 +416,8 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame, spin_unlock_irqrestore(&crc->lock, flags); if (!was_overflow) - DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n"); + drm_err(crtc->dev, + "Overflow of CRC buffer, userspace reads too slow.\n"); return -ENOBUFS; } diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index dfb73c9d7930..5802d714ad8d 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -163,7 +163,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); if (ret) { - DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); + drm_err(dev, "DRM: Failed to initialize /sys/kernel/debug/dri.\n"); goto err_debugfs; } @@ -402,7 +402,7 @@ void drm_put_dev(struct drm_device *dev) DRM_DEBUG("\n"); if (!dev) { - DRM_ERROR("cleanup called no dev\n"); + drm_err(NULL, "cleanup called no dev\n"); return; } @@ -517,7 +517,7 @@ static struct inode *drm_fs_inode_new(void) r = simple_pin_fs(&drm_fs_type, &drm_fs_mnt, &drm_fs_cnt); if (r < 0) { - DRM_ERROR("Cannot mount pseudo fs: %d\n", r); + drm_err(NULL, "Cannot mount pseudo fs: %d\n", r); return ERR_PTR(r); } @@ -587,7 +587,7 @@ static int drm_dev_init(struct drm_device *dev, int ret; if (!drm_core_init_complete) { - DRM_ERROR("DRM core is not initialized\n"); + drm_err(NULL, "DRM core is not initialized\n"); return -ENODEV; } @@ -625,7 +625,7 @@ static int drm_dev_init(struct drm_device *dev, inode = drm_fs_inode_new(); if (IS_ERR(inode)) { ret = PTR_ERR(inode); - DRM_ERROR("Cannot allocate anonymous inode: %d\n", ret); + drm_err(dev, "Cannot allocate anonymous inode: %d\n", ret); goto err; } @@ -650,7 +650,7 @@ static int drm_dev_init(struct drm_device *dev, if (drm_core_check_feature(dev, DRIVER_GEM)) { ret = drm_gem_init(dev); if (ret) { - DRM_ERROR("Cannot initialize graphics execution manager (GEM)\n"); + drm_err(dev, "Cannot initialize graphics execution manager (GEM)\n"); goto err; } } @@ -1054,7 +1054,7 @@ static int __init drm_core_init(void) ret = drm_sysfs_init(); if (ret < 0) { - DRM_ERROR("Cannot create DRM class: %d\n", ret); + drm_err(NULL, "Cannot create DRM class: %d\n", ret); goto error; } diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c index 060b753881a2..8cbf325a0414 100644 --- a/drivers/gpu/drm/drm_flip_work.c +++ b/drivers/gpu/drm/drm_flip_work.c @@ -82,7 +82,7 @@ void drm_flip_work_queue(struct drm_flip_work *work, void *val) if (task) { drm_flip_work_queue_task(work, task); } else { - DRM_ERROR("%s could not allocate task!\n", work->name); + drm_err(NULL, "%s could not allocate task!\n", work->name); work->func(work, val); } } diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index aff3746dedfb..b21071919644 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -1070,7 +1070,8 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) /* should turn off the crtc */ if (drm_crtc_force_disable(crtc)) - DRM_ERROR("failed to reset crtc %p when fb was deleted\n", crtc); + drm_err(dev, "failed to reset crtc %p when fb was deleted\n", + crtc); } } diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 59a0bb5ebd85..c14bff925a12 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -101,7 +101,7 @@ drm_gem_init(struct drm_device *dev) vma_offset_manager = drmm_kzalloc(dev, sizeof(*vma_offset_manager), GFP_KERNEL); if (!vma_offset_manager) { - DRM_ERROR("out of memory\n"); + drm_err(dev, "out of memory\n"); return -ENOMEM; } diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index 1e658c448366..1ba551b0ab97 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -583,7 +583,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret = dma_buf_vmap_unlocked(attach->dmabuf, &map); if (ret) { - DRM_ERROR("Failed to vmap PRIME buffer\n"); + drm_err(dev, "Failed to vmap PRIME buffer\n"); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c index 60afa1865559..a1ebf8e056c7 100644 --- a/drivers/gpu/drm/drm_hashtab.c +++ b/drivers/gpu/drm/drm_hashtab.c @@ -53,7 +53,7 @@ int drm_ht_create(struct drm_open_hash *ht, unsigned int order) else ht->table = vzalloc(array_size(size, sizeof(*ht->table))); if (!ht->table) { - DRM_ERROR("Out of memory for hash table\n"); + drm_err(NULL, "Out of memory for hash table\n"); return -ENOMEM; } return 0; @@ -157,7 +157,7 @@ int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *it } while(ret && (unshifted_key != first)); if (ret) { - DRM_ERROR("Available key bit space exhausted\n"); + drm_err(NULL, "Available key bit space exhausted\n"); return -EINVAL; } return 0; diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 1efbd5389d89..411f75a1ee14 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -79,8 +79,8 @@ int drm_lock_take(struct drm_lock_data *lock_data, if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { if (context != DRM_KERNEL_CONTEXT) { - DRM_ERROR("%d holds heavyweight lock\n", - context); + drm_err(NULL, "%d holds heavyweight lock\n", + context); } return 0; } @@ -142,8 +142,8 @@ static int drm_legacy_lock_free(struct drm_lock_data *lock_data, } while (prev != old); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { - DRM_ERROR("%d freed heavyweight lock held by %d\n", - context, _DRM_LOCKING_CONTEXT(old)); + drm_err(NULL, "%d freed heavyweight lock held by %d\n", + context, _DRM_LOCKING_CONTEXT(old)); return 1; } wake_up_interruptible(&lock_data->lock_queue); @@ -175,8 +175,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data, ++file_priv->lock_count; if (lock->context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - task_pid_nr(current), lock->context); + drm_err(dev, "Process %d using kernel context %d\n", + task_pid_nr(current), lock->context); return -EINVAL; } @@ -263,8 +263,8 @@ int drm_legacy_unlock(struct drm_device *dev, void *data, struct drm_file *file_ return -EOPNOTSUPP; if (lock->context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - task_pid_nr(current), lock->context); + drm_err(dev, "Process %d using kernel context %d\n", + task_pid_nr(current), lock->context); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index c871d9f096b8..58ff9503a403 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -603,7 +603,7 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev, drm_mode_copy(&dbidev->mode, mode); ret = mipi_dbi_rotate_mode(&dbidev->mode, rotation); if (ret) { - DRM_ERROR("Illegal rotation value %u\n", rotation); + drm_err(drm, "Illegal rotation value %u\n", rotation); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 497ef4b6a90a..d9d70601ccb4 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -161,13 +161,13 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *node) u32 reg; if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) { - drm_err(host, "modalias failure on %pOF\n", node); + drm_err(host->dev, "modalias failure on %pOF\n", node); return ERR_PTR(-EINVAL); } ret = of_property_read_u32(node, "reg", ®); if (ret) { - drm_err(host, "device node %pOF has no valid reg property: %d\n", + drm_err(host->dev, "device node %pOF has no valid reg property: %d\n", node, ret); return ERR_PTR(-EINVAL); } @@ -205,18 +205,18 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host, int ret; if (!info) { - drm_err(host, "invalid mipi_dsi_device_info pointer\n"); + drm_err(host->dev, "invalid mipi_dsi_device_info pointer\n"); return ERR_PTR(-EINVAL); } if (info->channel > 3) { - drm_err(host, "invalid virtual channel: %u\n", info->channel); + drm_err(host->dev, "invalid virtual channel: %u\n", info->channel); return ERR_PTR(-EINVAL); } dsi = mipi_dsi_device_alloc(host); if (IS_ERR(dsi)) { - drm_err(host, "failed to allocate DSI device %ld\n", + drm_err(host->dev, "failed to allocate DSI device %ld\n", PTR_ERR(dsi)); return dsi; } @@ -227,7 +227,7 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host, ret = mipi_dsi_device_add(dsi); if (ret) { - drm_err(host, "failed to add DSI device %d\n", ret); + drm_err(host->dev, "failed to add DSI device %d\n", ret); kfree(dsi); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 8257f9d4f619..0a8d62c8f359 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -126,14 +126,14 @@ static void show_leaks(struct drm_mm *mm) list_for_each_entry(node, drm_mm_nodes(mm), node_list) { if (!node->stack) { - DRM_ERROR("node [%08llx + %08llx]: unknown owner\n", - node->start, node->size); + drm_err(NULL, "node [%08llx + %08llx]: unknown owner\n", + node->start, node->size); continue; } stack_depot_snprint(node->stack, buf, BUFSZ, 0); - DRM_ERROR("node [%08llx + %08llx]: inserted at\n%s", - node->start, node->size, buf); + drm_err(NULL, "node [%08llx + %08llx]: inserted at\n%s", + node->start, node->size, buf); } kfree(buf); diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 87eb591fe9b5..b86473ab9ff7 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -513,7 +513,7 @@ void drm_mode_config_cleanup(struct drm_device *dev) if (WARN_ON(!list_empty(&dev->mode_config.connector_list))) { drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) - DRM_ERROR("connector %s leaked!\n", connector->name); + drm_err(dev, "connector %s leaked!\n", connector->name); drm_connector_list_iter_end(&conn_iter); } diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index be030f4a5311..cc6d1f216e78 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -372,8 +372,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hact_duration_ns < params->hact_ns.min || hact_duration_ns > params->hact_ns.max)) { - DRM_ERROR("Invalid horizontal active area duration: %uns (min: %u, max %u)\n", - hact_duration_ns, params->hact_ns.min, params->hact_ns.max); + drm_err(dev, "Invalid horizontal active area duration: %uns (min: %u, max %u)\n", + hact_duration_ns, params->hact_ns.min, params->hact_ns.max); return -EINVAL; } @@ -384,8 +384,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hblk_duration_ns < params->hblk_ns.min || hblk_duration_ns > params->hblk_ns.max)) { - DRM_ERROR("Invalid horizontal blanking duration: %uns (min: %u, max %u)\n", - hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max); + drm_err(dev, "Invalid horizontal blanking duration: %uns (min: %u, max %u)\n", + hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max); return -EINVAL; } @@ -396,8 +396,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hslen_duration_ns < params->hslen_ns.min || hslen_duration_ns > params->hslen_ns.max)) { - DRM_ERROR("Invalid horizontal sync duration: %uns (min: %u, max %u)\n", - hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max); + drm_err(dev, "Invalid horizontal sync duration: %uns (min: %u, max %u)\n", + hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max); return -EINVAL; } @@ -408,7 +408,7 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (porches_duration_ns > (params->hfp_ns.max + params->hbp_ns.max) || porches_duration_ns < (params->hfp_ns.min + params->hbp_ns.min))) { - DRM_ERROR("Invalid horizontal porches duration: %uns\n", porches_duration_ns); + drm_err(dev, "Invalid horizontal porches duration: %uns\n", porches_duration_ns); return -EINVAL; } @@ -430,8 +430,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hfp_duration_ns < params->hfp_ns.min || hfp_duration_ns > params->hfp_ns.max)) { - DRM_ERROR("Invalid horizontal front porch duration: %uns (min: %u, max %u)\n", - hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max); + drm_err(dev, "Invalid horizontal front porch duration: %uns (min: %u, max %u)\n", + hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max); return -EINVAL; } @@ -442,8 +442,8 @@ static int fill_analog_mode(struct drm_device *dev, if (!bt601 && (hbp_duration_ns < params->hbp_ns.min || hbp_duration_ns > params->hbp_ns.max)) { - DRM_ERROR("Invalid horizontal back porch duration: %uns (min: %u, max %u)\n", - hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max); + drm_err(dev, "Invalid horizontal back porch duration: %uns (min: %u, max %u)\n", + hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max); return -EINVAL; } @@ -494,8 +494,8 @@ static int fill_analog_mode(struct drm_device *dev, vtotal = vactive + vfp + vslen + vbp; if (params->num_lines != vtotal) { - DRM_ERROR("Invalid vertical total: %upx (expected %upx)\n", - vtotal, params->num_lines); + drm_err(dev, "Invalid vertical total: %upx (expected %upx)\n", + vtotal, params->num_lines); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_modeset_helper.c b/drivers/gpu/drm/drm_modeset_helper.c index f858dfedf2cf..e26b0285dde6 100644 --- a/drivers/gpu/drm/drm_modeset_helper.c +++ b/drivers/gpu/drm/drm_modeset_helper.c @@ -235,7 +235,7 @@ int drm_mode_config_helper_resume(struct drm_device *dev) ret = drm_atomic_helper_resume(dev, dev->mode_config.suspend_state); if (ret) - DRM_ERROR("Failed to resume (%d)\n", ret); + drm_err(dev, "Failed to resume (%d)\n", ret); dev->mode_config.suspend_state = NULL; drm_fb_helper_set_suspend_unlocked(dev->fb_helper, 0); diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 24e7998d1731..fc11efd5e560 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -611,7 +611,7 @@ void drm_plane_force_disable(struct drm_plane *plane) plane->old_fb = plane->fb; ret = plane->funcs->disable_plane(plane, NULL); if (ret) { - DRM_ERROR("failed to disable plane with busy fb\n"); + drm_err(plane->dev, "failed to disable plane with busy fb\n"); plane->old_fb = NULL; return; } diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c index f4e6184d1877..5b0b2140d535 100644 --- a/drivers/gpu/drm/drm_scatter.c +++ b/drivers/gpu/drm/drm_scatter.c @@ -170,9 +170,10 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, j++, tmp++) { if (*tmp != 0xcafebabe && error == 0) { error = 1; - DRM_ERROR("Scatter allocation error, " - "pagelist does not match " - "virtual mapping\n"); + drm_err(dev, + "Scatter allocation error, " + "pagelist does not match " + "virtual mapping\n"); } } tmp = page_address(entry->pagelist[i]); @@ -183,7 +184,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, } } if (error == 0) - DRM_ERROR("Scatter allocation matches pagelist\n"); + drm_err(dev, "Scatter allocation matches pagelist\n"); } #endif diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index f024dc93939e..cdb956af2079 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -547,7 +547,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) return drm_mmap_dma(filp, vma); if (drm_ht_find_item(&dev->map_hash, vma->vm_pgoff, &hash)) { - DRM_ERROR("Could not find map\n"); + drm_err(dev, "Could not find map\n"); return -EINVAL; } From patchwork Sat Jan 7 17:22:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385461wrt; Sat, 7 Jan 2023 09:25:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvMtgZlpaj6TEqOJY+FIYIzyKZ6EUKus+0mM0jd2DhmhlKAe2MSnAJboFyQRyGW8NIUwAAa X-Received: by 2002:a62:6d07:0:b0:581:b3f4:21f8 with SMTP id i7-20020a626d07000000b00581b3f421f8mr32509851pfc.31.1673112340820; Sat, 07 Jan 2023 09:25:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112340; cv=pass; d=google.com; s=arc-20160816; b=ZavDXGXTuJNMFZQ8i8g/F/bj1wMz267OHE4rM+uUU1gMQmAueybOdggGslDuIsOepJ h7t2QRWsDaWxmkEwiaheA0+8ZPsFmwgq47nmwVTTmfOFqY5KlX/k3TjZL+7x8pq7N7NC xCIUAxEcAlRm0WuSl5j6VoLDKQlaPjifwsIsikpsDZGTRRmOLV7xRkNIAoerzaJzNXoE 663N5dP5hqbI1F1EaQvXZJZSI21kdSTbplAivfeJt9Zo+7pIXNdEClqh2UOFpe/12KCD PY7do+x0Syv7FKtXnHiGy+Iq2hGyAxWBOItKQ+thv0CFGazoqnkRCASaDvRlyznCOzkc yX+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=Tezsa9MtF+FqGpwPVWMKb9b+LmzgDadZv0sldrMDyp8=; b=cJVH4H5L6Mtjwyp6mNp5QEtVxS5j8GEeh9ih3eCEXTMjRoPf5XyMGvbfRGMzlS6aay zUhAgSq5AOv9YG5T30qJO5iNZ4kRWazs/IcJy0aDXNvpREKMzuj/fZS6p2rtwe3NbVKp BMW7udNKvGTfSX8fC68nlef2c74/Ar2cK/Axeb+CLwK9xDncnk3mp3XUhroHDh4sCj/2 eTZ2NZnzGkQ0h2dKzMuyUNAOe8r0nF71qMvqB2MBM3d2nIIZYCg3Xgb6MEwktlHqKpWu q5Pt5Nl5sjUuH897GSp/nIuWJVKj0qCQkLuu9Q/gC8oktfi+uLd2W128OfxEf3RAjh6I sJNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=OsizknYz; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a056a00124e00b0056ce0f64370si4702503pfi.108.2023.01.07.09.25.27; Sat, 07 Jan 2023 09:25:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=OsizknYz; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234491AbjAGRYr (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbjAGRXz (ORCPT ); Sat, 7 Jan 2023 12:23:55 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE31D4D48F for ; Sat, 7 Jan 2023 09:23:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112190; cv=none; d=zohomail.in; s=zohoarc; b=DPSAIS9RPa9EGSGYvgRri12Vo5ELXNz4paaDFhw67EZiRJGJ31MjXfTJ9FZ3o7CzvFkYjRob/wdDWO6v3uRKFgRkpk6sNPrIcnEEWuWJ1Htg8ZhmJwT9LfQSykOq9D0BxX62Mk4zNha65h4/aVWq1ulMrb5M67vSDo82T26McJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Tezsa9MtF+FqGpwPVWMKb9b+LmzgDadZv0sldrMDyp8=; b=U/TUhtBLChRNI1mKeMj3X6vIV14+Xh+kNK6hE6dTV4Xl6KtYPt4n2HbS1xuKnbxIXHXD1vTlK+DkkdGQU+HgBUvJOw/ScX286Ozmh6tmVkxHAg1bfobmAVIqPeWtC6Eo0Ll0tV6b6C8DtkYFropsEVL3uhJmcEIE4B3q0h6bERQ= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112190; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=Tezsa9MtF+FqGpwPVWMKb9b+LmzgDadZv0sldrMDyp8=; b=OsizknYz5dRPe/HrJ8LuqvI0iz4fHsdQVJTL/eCCcQ3s4uCYpEH94mk7SzrTTK4G vkhKU0w4J1x6zDn4BwxrqZH8d2h/dh30Zopi67ZGVMI1woU9AG6p9BchaWf1+zHGSFx QIfVbbIfykZGkMVYM17r6UnsTVoAVOANSTtbJm4k= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112188141470.87457470961976; Sat, 7 Jan 2023 22:53:08 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v5 05/10] drm: Remove usage of deprecated DRM_DEBUG Date: Sat, 7 Jan 2023 22:52:25 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385445555639492?= X-GMAIL-MSGID: =?utf-8?q?1754385445555639492?= drm_print.h says DRM_DEBUG is deprecated in favor of drm_dbg_core(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_agpsupport.c | 4 +- drivers/gpu/drm/drm_bufs.c | 114 +++++++++++++++--------------- drivers/gpu/drm/drm_context.c | 14 ++-- drivers/gpu/drm/drm_dma.c | 10 +-- drivers/gpu/drm/drm_drv.c | 10 +-- drivers/gpu/drm/drm_gem.c | 5 +- drivers/gpu/drm/drm_hashtab.c | 6 +- drivers/gpu/drm/drm_irq.c | 4 +- drivers/gpu/drm/drm_lease.c | 2 +- drivers/gpu/drm/drm_legacy_misc.c | 4 +- drivers/gpu/drm/drm_lock.c | 20 +++--- drivers/gpu/drm/drm_mode_object.c | 6 +- drivers/gpu/drm/drm_pci.c | 12 ++-- drivers/gpu/drm/drm_plane.c | 12 ++-- drivers/gpu/drm/drm_scatter.c | 10 +-- drivers/gpu/drm/drm_syncobj.c | 2 +- drivers/gpu/drm/drm_sysfs.c | 14 ++-- drivers/gpu/drm/drm_vm.c | 43 ++++++----- 18 files changed, 150 insertions(+), 142 deletions(-) diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c index a4ad6fd13abc..d27686d6e82d 100644 --- a/drivers/gpu/drm/drm_agpsupport.c +++ b/drivers/gpu/drm/drm_agpsupport.c @@ -315,8 +315,8 @@ int drm_legacy_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) if (retcode) return retcode; entry->bound = dev->agp->base + (page << PAGE_SHIFT); - DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n", - dev->agp->base, entry->bound); + drm_dbg_core(dev, "base = 0x%lx entry->bound = 0x%lx\n", + dev->agp->base, entry->bound); return 0; } EXPORT_SYMBOL(drm_legacy_agp_bind); diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 98aaf3379a3b..feedd7c6f0d5 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -171,8 +171,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset, kfree(map); return -EINVAL; } - DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n", - (unsigned long long)map->offset, map->size, map->type); + drm_dbg_core(dev, "offset = 0x%08llx, size = 0x%08lx, type = %d\n", + (unsigned long long)map->offset, map->size, map->type); /* page-align _DRM_SHM maps. They are allocated here so there is no security * hole created by that and it works around various broken drivers that use @@ -205,10 +205,10 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset, list = drm_find_matching_map(dev, map); if (list != NULL) { if (list->map->size != map->size) { - DRM_DEBUG("Matching maps of type %d with " - "mismatched sizes, (%ld vs %ld)\n", - map->type, map->size, - list->map->size); + drm_dbg_core(dev, "Matching maps of type %d with " + "mismatched sizes, (%ld vs %ld)\n", + map->type, map->size, + list->map->size); list->map->size = map->size; } @@ -239,9 +239,9 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset, list = drm_find_matching_map(dev, map); if (list != NULL) { if (list->map->size != map->size) { - DRM_DEBUG("Matching maps of type %d with " - "mismatched sizes, (%ld vs %ld)\n", - map->type, map->size, list->map->size); + drm_dbg_core(dev, "Matching maps of type %d with " + "mismatched sizes, (%ld vs %ld)\n", + map->type, map->size, list->map->size); list->map->size = map->size; } @@ -250,8 +250,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset, return 0; } map->handle = vmalloc_user(map->size); - DRM_DEBUG("%lu %d %p\n", - map->size, order_base_2(map->size), map->handle); + drm_dbg_core(dev, "%lu %d %p\n", + map->size, order_base_2(map->size), map->handle); if (!map->handle) { kfree(map); return -ENOMEM; @@ -308,8 +308,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset, kfree(map); return -EPERM; } - DRM_DEBUG("AGP offset = 0x%08llx, size = 0x%08lx\n", - (unsigned long long)map->offset, map->size); + drm_dbg_core(dev, "AGP offset = 0x%08llx, size = 0x%08lx\n", + (unsigned long long)map->offset, map->size); break; } @@ -749,13 +749,13 @@ int drm_legacy_addbufs_agp(struct drm_device *dev, byte_count = 0; agp_offset = dev->agp->base + request->agp_start; - DRM_DEBUG("count: %d\n", count); - DRM_DEBUG("order: %d\n", order); - DRM_DEBUG("size: %d\n", size); - DRM_DEBUG("agp_offset: %lx\n", agp_offset); - DRM_DEBUG("alignment: %d\n", alignment); - DRM_DEBUG("page_order: %d\n", page_order); - DRM_DEBUG("total: %d\n", total); + drm_dbg_core(dev, "count: %d\n", count); + drm_dbg_core(dev, "order: %d\n", order); + drm_dbg_core(dev, "size: %d\n", size); + drm_dbg_core(dev, "agp_offset: %lx\n", agp_offset); + drm_dbg_core(dev, "alignment: %d\n", alignment); + drm_dbg_core(dev, "page_order: %d\n", page_order); + drm_dbg_core(dev, "total: %d\n", total); if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL; @@ -770,7 +770,7 @@ int drm_legacy_addbufs_agp(struct drm_device *dev, } } if (!list_empty(&dev->agp->memory) && !valid) { - DRM_DEBUG("zone invalid\n"); + drm_dbg_core(dev, "zone invalid\n"); return -EINVAL; } spin_lock(&dev->buf_lock); @@ -833,14 +833,15 @@ int drm_legacy_addbufs_agp(struct drm_device *dev, return -ENOMEM; } - DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address); + drm_dbg_core(dev, "buffer %d @ %p\n", entry->buf_count, + buf->address); offset += alignment; entry->buf_count++; byte_count += PAGE_SIZE << page_order; } - DRM_DEBUG("byte_count: %d\n", byte_count); + drm_dbg_core(dev, "byte_count: %d\n", byte_count); temp_buflist = krealloc(dma->buflist, (dma->buf_count + entry->buf_count) * @@ -863,8 +864,8 @@ int drm_legacy_addbufs_agp(struct drm_device *dev, dma->page_count += byte_count >> PAGE_SHIFT; dma->byte_count += byte_count; - DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); - DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); + drm_dbg_core(dev, "dma->buf_count : %d\n", dma->buf_count); + drm_dbg_core(dev, "entry->buf_count : %d\n", entry->buf_count); mutex_unlock(&dev->struct_mutex); @@ -912,8 +913,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev, order = order_base_2(request->size); size = 1 << order; - DRM_DEBUG("count=%d, size=%d (%d), order=%d\n", - request->count, request->size, size, order); + drm_dbg_core(dev, "count=%d, size=%d (%d), order=%d\n", + request->count, request->size, size, order); if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL; @@ -975,8 +976,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev, } memcpy(temp_pagelist, dma->pagelist, dma->page_count * sizeof(*dma->pagelist)); - DRM_DEBUG("pagelist: %d entries\n", - dma->page_count + (count << page_order)); + drm_dbg_core(dev, "pagelist: %d entries\n", + dma->page_count + (count << page_order)); entry->buf_size = size; entry->page_order = page_order; @@ -1015,9 +1016,9 @@ int drm_legacy_addbufs_pci(struct drm_device *dev, } entry->seglist[entry->seg_count++] = dmah; for (i = 0; i < (1 << page_order); i++) { - DRM_DEBUG("page %d @ 0x%08lx\n", - dma->page_count + page_count, - (unsigned long)dmah->vaddr + PAGE_SIZE * i); + drm_dbg_core(dev, "page %d @ 0x%08lx\n", + dma->page_count + page_count, + (unsigned long)dmah->vaddr + PAGE_SIZE * i); temp_pagelist[dma->page_count + page_count++] = (unsigned long)dmah->vaddr + PAGE_SIZE * i; } @@ -1051,8 +1052,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev, return -ENOMEM; } - DRM_DEBUG("buffer %d @ %p\n", - entry->buf_count, buf->address); + drm_dbg_core(dev, "buffer %d @ %p\n", + entry->buf_count, buf->address); } byte_count += PAGE_SIZE << page_order; } @@ -1140,13 +1141,13 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev, byte_count = 0; agp_offset = request->agp_start; - DRM_DEBUG("count: %d\n", count); - DRM_DEBUG("order: %d\n", order); - DRM_DEBUG("size: %d\n", size); - DRM_DEBUG("agp_offset: %lu\n", agp_offset); - DRM_DEBUG("alignment: %d\n", alignment); - DRM_DEBUG("page_order: %d\n", page_order); - DRM_DEBUG("total: %d\n", total); + drm_dbg_core(dev, "count: %d\n", count); + drm_dbg_core(dev, "order: %d\n", order); + drm_dbg_core(dev, "size: %d\n", size); + drm_dbg_core(dev, "agp_offset: %lu\n", agp_offset); + drm_dbg_core(dev, "alignment: %d\n", alignment); + drm_dbg_core(dev, "page_order: %d\n", page_order); + drm_dbg_core(dev, "total: %d\n", total); if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL; @@ -1212,14 +1213,15 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev, return -ENOMEM; } - DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address); + drm_dbg_core(dev, "buffer %d @ %p\n", entry->buf_count, + buf->address); offset += alignment; entry->buf_count++; byte_count += PAGE_SIZE << page_order; } - DRM_DEBUG("byte_count: %d\n", byte_count); + drm_dbg_core(dev, "byte_count: %d\n", byte_count); temp_buflist = krealloc(dma->buflist, (dma->buf_count + entry->buf_count) * @@ -1242,8 +1244,8 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev, dma->page_count += byte_count >> PAGE_SHIFT; dma->byte_count += byte_count; - DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); - DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); + drm_dbg_core(dev, "dma->buf_count : %d\n", dma->buf_count); + drm_dbg_core(dev, "entry->buf_count : %d\n", entry->buf_count); mutex_unlock(&dev->struct_mutex); @@ -1344,7 +1346,7 @@ int __drm_legacy_infobufs(struct drm_device *dev, ++count; } - DRM_DEBUG("count = %d\n", count); + drm_dbg_core(dev, "count = %d\n", count); if (*p >= count) { for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { @@ -1353,12 +1355,12 @@ int __drm_legacy_infobufs(struct drm_device *dev, if (from->buf_count) { if (f(data, count, from) < 0) return -EFAULT; - DRM_DEBUG("%d %d %d %d %d\n", - i, - dma->bufs[i].buf_count, - dma->bufs[i].buf_size, - dma->bufs[i].low_mark, - dma->bufs[i].high_mark); + drm_dbg_core(dev, "%d %d %d %d %d\n", + i, + dma->bufs[i].buf_count, + dma->bufs[i].buf_size, + dma->bufs[i].low_mark, + dma->bufs[i].high_mark); ++count; } } @@ -1421,8 +1423,8 @@ int drm_legacy_markbufs(struct drm_device *dev, void *data, if (!dma) return -EINVAL; - DRM_DEBUG("%d, %d, %d\n", - request->size, request->low_mark, request->high_mark); + drm_dbg_core(dev, "%d, %d, %d\n", + request->size, request->low_mark, request->high_mark); order = order_base_2(request->size); if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL; @@ -1469,7 +1471,7 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data, if (!dma) return -EINVAL; - DRM_DEBUG("%d\n", request->count); + drm_dbg_core(dev, "%d\n", request->count); for (i = 0; i < request->count; i++) { if (copy_from_user(&idx, &request->list[i], sizeof(idx))) return -EFAULT; @@ -1569,7 +1571,7 @@ int __drm_legacy_mapbufs(struct drm_device *dev, void *data, int *p, } done: *p = dma->buf_count; - DRM_DEBUG("%d buffers, retcode = %d\n", *p, retcode); + drm_dbg_core(dev, "%d buffers, retcode = %d\n", *p, retcode); return retcode; } diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c index f6d68fad8311..c52764e98d26 100644 --- a/drivers/gpu/drm/drm_context.c +++ b/drivers/gpu/drm/drm_context.c @@ -280,7 +280,7 @@ static int drm_context_switch(struct drm_device * dev, int old, int new) return -EBUSY; } - DRM_DEBUG("Context switch from %d to %d\n", old, new); + drm_dbg_core(dev, "Context switch from %d to %d\n", old, new); if (new == dev->last_context) { clear_bit(0, &dev->context_flag); @@ -379,9 +379,9 @@ int drm_legacy_addctx(struct drm_device *dev, void *data, /* Skip kernel's context and get a new one. */ tmp_handle = drm_legacy_ctxbitmap_next(dev); } - DRM_DEBUG("%d\n", tmp_handle); + drm_dbg_core(dev, "%d\n", tmp_handle); if (tmp_handle < 0) { - DRM_DEBUG("Not enough free contexts.\n"); + drm_dbg_core(dev, "Not enough free contexts.\n"); /* Should this return -EBUSY instead? */ return tmp_handle; } @@ -390,7 +390,7 @@ int drm_legacy_addctx(struct drm_device *dev, void *data, ctx_entry = kmalloc(sizeof(*ctx_entry), GFP_KERNEL); if (!ctx_entry) { - DRM_DEBUG("out of memory\n"); + drm_dbg_core(dev, "out of memory\n"); return -ENOMEM; } @@ -449,7 +449,7 @@ int drm_legacy_switchctx(struct drm_device *dev, void *data, !drm_core_check_feature(dev, DRIVER_LEGACY)) return -EOPNOTSUPP; - DRM_DEBUG("%d\n", ctx->handle); + drm_dbg_core(dev, "%d\n", ctx->handle); return drm_context_switch(dev, dev->last_context, ctx->handle); } @@ -473,7 +473,7 @@ int drm_legacy_newctx(struct drm_device *dev, void *data, !drm_core_check_feature(dev, DRIVER_LEGACY)) return -EOPNOTSUPP; - DRM_DEBUG("%d\n", ctx->handle); + drm_dbg_core(dev, "%d\n", ctx->handle); drm_context_switch_complete(dev, file_priv, ctx->handle); return 0; @@ -499,7 +499,7 @@ int drm_legacy_rmctx(struct drm_device *dev, void *data, !drm_core_check_feature(dev, DRIVER_LEGACY)) return -EOPNOTSUPP; - DRM_DEBUG("%d\n", ctx->handle); + drm_dbg_core(dev, "%d\n", ctx->handle); if (ctx->handle != DRM_KERNEL_CONTEXT) { if (dev->driver->context_dtor) dev->driver->context_dtor(dev, ctx->handle); diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c index eb6b741a6f99..dac137072c33 100644 --- a/drivers/gpu/drm/drm_dma.c +++ b/drivers/gpu/drm/drm_dma.c @@ -94,11 +94,11 @@ void drm_legacy_dma_takedown(struct drm_device *dev) /* Clear dma buffers */ for (i = 0; i <= DRM_MAX_ORDER; i++) { if (dma->bufs[i].seg_count) { - DRM_DEBUG("order %d: buf_count = %d," - " seg_count = %d\n", - i, - dma->bufs[i].buf_count, - dma->bufs[i].seg_count); + drm_dbg_core(dev, "order %d: buf_count = %d," + " seg_count = %d\n", + i, + dma->bufs[i].buf_count, + dma->bufs[i].seg_count); for (j = 0; j < dma->bufs[i].seg_count; j++) { if (dma->bufs[i].seglist[j]) { dmah = dma->bufs[i].seglist[j]; diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 5802d714ad8d..f49e3342cca2 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -155,7 +155,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) unsigned long flags; int ret; - DRM_DEBUG("\n"); + drm_dbg_core(dev, "\n"); minor = *drm_minor_get_slot(dev, type); if (!minor) @@ -176,7 +176,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) idr_replace(&drm_minors_idr, minor, minor->index); spin_unlock_irqrestore(&drm_minor_lock, flags); - DRM_DEBUG("new minor registered %d\n", minor->index); + drm_dbg_core(dev, "new minor registered %d\n", minor->index); return 0; err_debugfs: @@ -399,7 +399,7 @@ void drm_minor_release(struct drm_minor *minor) */ void drm_put_dev(struct drm_device *dev) { - DRM_DEBUG("\n"); + drm_dbg_core(NULL, "\n"); if (!dev) { drm_err(NULL, "cleanup called no dev\n"); @@ -1004,7 +1004,7 @@ static int drm_stub_open(struct inode *inode, struct file *filp) struct drm_minor *minor; int err; - DRM_DEBUG("\n"); + drm_dbg_core(NULL, "\n"); minor = drm_minor_acquire(iminor(inode)); if (IS_ERR(minor)) @@ -1068,7 +1068,7 @@ static int __init drm_core_init(void) drm_core_init_complete = true; - DRM_DEBUG("Initialized\n"); + drm_dbg_core(NULL, "Initialized\n"); return 0; error: diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index c14bff925a12..4434b1de7102 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -712,7 +712,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles, if (copy_from_user(handles, bo_handles, count * sizeof(u32))) { ret = -EFAULT; - DRM_DEBUG("Failed to copy in GEM handles\n"); + drm_dbg_core(filp->minor->dev, "Failed to copy in GEM handles\n"); goto out; } @@ -767,7 +767,8 @@ long drm_gem_dma_resv_wait(struct drm_file *filep, u32 handle, obj = drm_gem_object_lookup(filep, handle); if (!obj) { - DRM_DEBUG("Failed to look up GEM BO %d\n", handle); + drm_dbg_core(filep->minor->dev, + "Failed to look up GEM BO %d\n", handle); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c index a1ebf8e056c7..357f20d73b43 100644 --- a/drivers/gpu/drm/drm_hashtab.c +++ b/drivers/gpu/drm/drm_hashtab.c @@ -67,10 +67,12 @@ void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key) int count = 0; hashed_key = hash_long(key, ht->order); - DRM_DEBUG("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key); + drm_dbg_core(NULL, "Key is 0x%08lx, Hashed key is 0x%08x\n", + key, hashed_key); h_list = &ht->table[hashed_key]; hlist_for_each_entry(entry, h_list, head) - DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key); + drm_dbg_core(NULL, "count %d, key: 0x%08lx\n", + count++, entry->key); } static struct hlist_node *drm_ht_find_key(struct drm_open_hash *ht, diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index d327638e15ee..e70d6975310c 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -78,7 +78,7 @@ static int drm_legacy_irq_install(struct drm_device *dev, int irq) return -EBUSY; dev->irq_enabled = true; - DRM_DEBUG("irq=%d\n", irq); + drm_dbg_core(dev, "irq=%d\n", irq); /* Before installing handler */ if (dev->driver->irq_preinstall) @@ -146,7 +146,7 @@ int drm_legacy_irq_uninstall(struct drm_device *dev) if (!irq_enabled) return -EINVAL; - DRM_DEBUG("irq=%d\n", dev->irq); + drm_dbg_core(dev, "irq=%d\n", dev->irq); if (drm_core_check_feature(dev, DRIVER_LEGACY)) vga_client_unregister(to_pci_dev(dev->dev)); diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index d72c2fac0ff1..a4b50fdbaaf7 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -673,7 +673,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, count++; } - DRM_DEBUG("lease holds %d objects\n", count); + drm_dbg_core(dev, "lease holds %d objects\n", count); if (ret == 0) arg->count_objects = count; diff --git a/drivers/gpu/drm/drm_legacy_misc.c b/drivers/gpu/drm/drm_legacy_misc.c index d4c5434062d7..ad0eef292cb0 100644 --- a/drivers/gpu/drm/drm_legacy_misc.c +++ b/drivers/gpu/drm/drm_legacy_misc.c @@ -70,7 +70,7 @@ int drm_legacy_setup(struct drm_device * dev) return ret; - DRM_DEBUG("\n"); + drm_dbg_core(dev, "\n"); return 0; } @@ -95,7 +95,7 @@ void drm_legacy_dev_reinit(struct drm_device *dev) dev->last_context = 0; dev->if_version = 0; - DRM_DEBUG("lastclose completed\n"); + drm_dbg_core(dev, "lastclose completed\n"); } void drm_master_legacy_init(struct drm_master *master) diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 411f75a1ee14..fea573dcb016 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c @@ -180,10 +180,10 @@ int drm_legacy_lock(struct drm_device *dev, void *data, return -EINVAL; } - DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", - lock->context, task_pid_nr(current), - master->lock.hw_lock ? master->lock.hw_lock->lock : -1, - lock->flags); + drm_dbg_core(dev, "%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", + lock->context, task_pid_nr(current), + master->lock.hw_lock ? master->lock.hw_lock->lock : -1, + lock->flags); add_wait_queue(&master->lock.lock_queue, &entry); spin_lock_bh(&master->lock.spinlock); @@ -219,8 +219,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data, __set_current_state(TASK_RUNNING); remove_wait_queue(&master->lock.lock_queue, &entry); - DRM_DEBUG("%d %s\n", lock->context, - ret ? "interrupted" : "has lock"); + drm_dbg_core(dev, "%d %s\n", lock->context, + ret ? "interrupted" : "has lock"); if (ret) return ret; /* don't set the block all signals on the master process for now @@ -234,8 +234,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data, if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) { if (dev->driver->dma_quiescent(dev)) { - DRM_DEBUG("%d waiting for DMA quiescent\n", - lock->context); + drm_dbg_core(dev, "%d waiting for DMA quiescent\n", + lock->context); return -EBUSY; } } @@ -345,8 +345,8 @@ void drm_legacy_lock_release(struct drm_device *dev, struct file *filp) return; if (drm_legacy_i_have_hw_lock(dev, file_priv)) { - DRM_DEBUG("File %p released, freeing lock for context %d\n", - filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock)); + drm_dbg_core(dev, "File %p released, freeing lock for context %d\n", + filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock)); drm_legacy_lock_free(&file_priv->master->lock, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock)); } diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c index ba1608effc0f..6e5a970043fc 100644 --- a/drivers/gpu/drm/drm_mode_object.c +++ b/drivers/gpu/drm/drm_mode_object.c @@ -192,7 +192,8 @@ EXPORT_SYMBOL(drm_mode_object_find); void drm_mode_object_put(struct drm_mode_object *obj) { if (obj->free_cb) { - DRM_DEBUG("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount)); + drm_dbg_core(NULL, "OBJ ID: %d (%d)\n", obj->id, + kref_read(&obj->refcount)); kref_put(&obj->refcount, obj->free_cb); } } @@ -209,7 +210,8 @@ EXPORT_SYMBOL(drm_mode_object_put); void drm_mode_object_get(struct drm_mode_object *obj) { if (obj->free_cb) { - DRM_DEBUG("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount)); + drm_dbg_core(NULL, "OBJ ID: %d (%d)\n", obj->id, + kref_read(&obj->refcount)); kref_get(&obj->refcount); } } diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 7dfb837d1325..485ec407a115 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -85,8 +85,8 @@ static int drm_legacy_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_bu p->irq = pdev->irq; - DRM_DEBUG("%d:%d:%d => IRQ %d\n", p->busnum, p->devnum, p->funcnum, - p->irq); + drm_dbg_core(dev, "%d:%d:%d => IRQ %d\n", + p->busnum, p->devnum, p->funcnum, p->irq); return 0; } @@ -151,12 +151,12 @@ static int drm_legacy_get_pci_dev(struct pci_dev *pdev, struct drm_device *dev; int ret; - DRM_DEBUG("\n"); - dev = drm_dev_alloc(driver, &pdev->dev); if (IS_ERR(dev)) return PTR_ERR(dev); + drm_dbg_core(dev, "\n"); + ret = pci_enable_device(pdev); if (ret) goto err_free; @@ -203,7 +203,7 @@ int drm_legacy_pci_init(const struct drm_driver *driver, const struct pci_device_id *pid; int i; - DRM_DEBUG("\n"); + drm_dbg_core(NULL, "\n"); if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY))) return -EINVAL; @@ -247,7 +247,7 @@ void drm_legacy_pci_exit(const struct drm_driver *driver, { struct drm_device *dev, *tmp; - DRM_DEBUG("\n"); + drm_dbg_core(NULL, "\n"); if (!(driver->driver_features & DRIVER_LEGACY)) { WARN_ON(1); diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index fc11efd5e560..1e8727b7bce9 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -1260,17 +1260,19 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, switch (page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET) { case DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE: if ((int)(target_vblank - current_vblank) > 1) { - DRM_DEBUG("Invalid absolute flip target %u, " - "must be <= %u\n", target_vblank, - current_vblank + 1); + drm_dbg_core(dev, + "Invalid absolute flip target %u, " + "must be <= %u\n", target_vblank, + current_vblank + 1); drm_crtc_vblank_put(crtc); return -EINVAL; } break; case DRM_MODE_PAGE_FLIP_TARGET_RELATIVE: if (target_vblank != 0 && target_vblank != 1) { - DRM_DEBUG("Invalid relative flip target %u, " - "must be 0 or 1\n", target_vblank); + drm_dbg_core(dev, + "Invalid relative flip target %u, " + "must be 0 or 1\n", target_vblank); drm_crtc_vblank_put(crtc); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c index 5b0b2140d535..08b3eb586484 100644 --- a/drivers/gpu/drm/drm_scatter.c +++ b/drivers/gpu/drm/drm_scatter.c @@ -82,7 +82,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, struct drm_sg_mem *entry; unsigned long pages, i, j; - DRM_DEBUG("\n"); + drm_dbg_core(dev, "\n"); if (!drm_core_check_feature(dev, DRIVER_LEGACY)) return -EOPNOTSUPP; @@ -101,7 +101,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, return -ENOMEM; pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE; - DRM_DEBUG("size=%ld pages=%ld\n", request->size, pages); + drm_dbg_core(dev, "size=%ld pages=%ld\n", request->size, pages); entry->pages = pages; entry->pagelist = kcalloc(pages, sizeof(*entry->pagelist), GFP_KERNEL); @@ -132,8 +132,8 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data, entry->handle = ScatterHandle((unsigned long)entry->virtual); - DRM_DEBUG("handle = %08lx\n", entry->handle); - DRM_DEBUG("virtual = %p\n", entry->virtual); + drm_dbg_core(dev, "handle = %08lx\n", entry->handle); + drm_dbg_core(dev, "virtual = %p\n", entry->virtual); for (i = (unsigned long)entry->virtual, j = 0; j < pages; i += PAGE_SIZE, j++) { @@ -213,7 +213,7 @@ int drm_legacy_sg_free(struct drm_device *dev, void *data, if (!entry || entry->handle != request->handle) return -EINVAL; - DRM_DEBUG("virtual = %p\n", entry->virtual); + drm_dbg_core(dev, "virtual = %p\n", entry->virtual); drm_sg_cleanup(entry); diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index 0c2be8360525..e84957a0f319 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -298,7 +298,7 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj, prev = drm_syncobj_fence_get(syncobj); /* You are adding an unorder point to timeline, which could cause payload returned from query_ioctl is 0! */ if (prev && prev->seqno >= point) - DRM_DEBUG("You are adding an unorder point to timeline!\n"); + drm_dbg_core(NULL, "You are adding an unorder point to timeline!\n"); dma_fence_chain_init(chain, prev, fence, point); rcu_assign_pointer(syncobj->fence, &chain->base); diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 430e00b16eec..ee810d493b6e 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -341,8 +341,8 @@ int drm_sysfs_connector_add(struct drm_connector *connector) if (r) goto err_free; - DRM_DEBUG("adding \"%s\" to sysfs\n", - connector->name); + drm_dbg_core(dev, "adding \"%s\" to sysfs\n", + connector->name); r = device_add(kdev); if (r) { @@ -370,8 +370,8 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) if (connector->ddc) sysfs_remove_link(&connector->kdev->kobj, "ddc"); - DRM_DEBUG("removing \"%s\" from sysfs\n", - connector->name); + drm_dbg_core(connector->dev, "removing \"%s\" from sysfs\n", + connector->name); device_unregister(connector->kdev); connector->kdev = NULL; @@ -382,7 +382,7 @@ void drm_sysfs_lease_event(struct drm_device *dev) char *event_string = "LEASE=1"; char *envp[] = { event_string, NULL }; - DRM_DEBUG("generating lease event\n"); + drm_dbg_core(dev, "generating lease event\n"); kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); } @@ -403,7 +403,7 @@ void drm_sysfs_hotplug_event(struct drm_device *dev) char *event_string = "HOTPLUG=1"; char *envp[] = { event_string, NULL }; - DRM_DEBUG("generating hotplug event\n"); + drm_dbg_core(dev, "generating hotplug event\n"); kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); } @@ -459,7 +459,7 @@ void drm_sysfs_connector_status_event(struct drm_connector *connector, snprintf(prop_id, ARRAY_SIZE(prop_id), "PROPERTY=%u", property->base.id); - DRM_DEBUG("generating connector status event\n"); + drm_dbg_core(dev, "generating connector status event\n"); kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); } diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index cdb956af2079..6349807e8898 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -168,12 +168,11 @@ static vm_fault_t drm_vm_fault(struct vm_fault *vmf) get_page(page); vmf->page = page; - DRM_DEBUG - ("baddr = 0x%llx page = 0x%p, offset = 0x%llx, count=%d\n", - (unsigned long long)baddr, - agpmem->memory->pages[offset], - (unsigned long long)offset, - page_count(page)); + drm_dbg_core(dev, "baddr = 0x%llx page = 0x%p, offset = 0x%llx, count=%d\n", + (unsigned long long)baddr, + agpmem->memory->pages[offset], + (unsigned long long)offset, + page_count(page)); return 0; } vm_fault_error: @@ -215,7 +214,7 @@ static vm_fault_t drm_vm_shm_fault(struct vm_fault *vmf) get_page(page); vmf->page = page; - DRM_DEBUG("shm_fault 0x%lx\n", offset); + drm_dbg_core(NULL, "shm_fault 0x%lx\n", offset); return 0; } @@ -236,8 +235,8 @@ static void drm_vm_shm_close(struct vm_area_struct *vma) struct drm_map_list *r_list; int found_maps = 0; - DRM_DEBUG("0x%08lx,0x%08lx\n", - vma->vm_start, vma->vm_end - vma->vm_start); + drm_dbg_core(dev, "0x%08lx,0x%08lx\n", + vma->vm_start, vma->vm_end - vma->vm_start); map = vma->vm_private_data; @@ -319,7 +318,7 @@ static vm_fault_t drm_vm_dma_fault(struct vm_fault *vmf) get_page(page); vmf->page = page; - DRM_DEBUG("dma_fault 0x%lx (page %lu)\n", offset, page_nr); + drm_dbg_core(dev, "dma_fault 0x%lx (page %lu)\n", offset, page_nr); return 0; } @@ -391,8 +390,8 @@ static void drm_vm_open_locked(struct drm_device *dev, { struct drm_vma_entry *vma_entry; - DRM_DEBUG("0x%08lx,0x%08lx\n", - vma->vm_start, vma->vm_end - vma->vm_start); + drm_dbg_core(dev, "0x%08lx,0x%08lx\n", + vma->vm_start, vma->vm_end - vma->vm_start); vma_entry = kmalloc(sizeof(*vma_entry), GFP_KERNEL); if (vma_entry) { @@ -417,8 +416,8 @@ static void drm_vm_close_locked(struct drm_device *dev, { struct drm_vma_entry *pt, *temp; - DRM_DEBUG("0x%08lx,0x%08lx\n", - vma->vm_start, vma->vm_end - vma->vm_start); + drm_dbg_core(dev, "0x%08lx,0x%08lx\n", + vma->vm_start, vma->vm_end - vma->vm_start); list_for_each_entry_safe(pt, temp, &dev->vmalist, head) { if (pt->vma == vma) { @@ -466,8 +465,8 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) dev = priv->minor->dev; dma = dev->dma; - DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", - vma->vm_start, vma->vm_end, vma->vm_pgoff); + drm_dbg_core(dev, "start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", + vma->vm_start, vma->vm_end, vma->vm_pgoff); /* Length must match exact page count */ if (!dma || (length >> PAGE_SHIFT) != dma->page_count) { @@ -528,8 +527,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) resource_size_t offset = 0; struct drm_hash_item *hash; - DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", - vma->vm_start, vma->vm_end, vma->vm_pgoff); + drm_dbg_core(dev, "start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n", + vma->vm_start, vma->vm_end, vma->vm_pgoff); if (!priv->authenticated) return -EACCES; @@ -600,10 +599,10 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma) vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; - DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx," - " offset = 0x%llx\n", - map->type, - vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset)); + drm_dbg_core(dev, + " Type = %d; start = 0x%lx, end = 0x%lx, offset = 0x%llx\n", + map->type, vma->vm_start, vma->vm_end, + (unsigned long long)(map->offset + offset)); vma->vm_ops = &drm_vm_ops; break; From patchwork Sat Jan 7 17:22:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385210wrt; Sat, 7 Jan 2023 09:25:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXuuPeKCa4jb5D/+TmCYeCKV5lXa128aQVaI27+Yc0YgRXto2zkmwJYREgObF27dOgLB+Cul X-Received: by 2002:a17:903:110d:b0:189:89e2:5406 with SMTP id n13-20020a170903110d00b0018989e25406mr103842556plh.24.1673112308382; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=1LQ+o1mLWMGYFmSIoOhuXc77pB4LFIGJwmV5uA/JvB6xUDlP88Z9F251fcX9BF37FR tWM1fbj7MFkgT4G7yRTVckW+eMn/qkU837JO33aT9bzIELwSs1n/YqtRYwptsvq0sEHm KJZyWeKl6fP1X1lu6uHB14pUKxHrh6pELpnO5++ghwtOVIQLd/GIJvG1EzXrYbWfY1M0 dflKYt8jU45GRAj1JbYx3zepA+pSAABXslExUzylPBxQpUBzZF4uSvyuiJ2TbrqeGoQ+ axc/rH5HjosE5RbAiKN4jDzYfVoyrSQ6cp3iGfFC1BewRQmA6PjjHoHxtU6kU0wqlQbi XKtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=v7XtqjUz6nWh5jT4nFI+X6V58+yGokbG8rQPFlgJWNc=; b=JxSrOVxa1T2wM6OzjIFLBQ2ydHIEcmiuY9IzTtAa8CElA/A1rsnrycn0CU+3YrCED1 faQo4GpyBnpC0ijTjLQGUyTXJTiX6FQgwhpq5sjLPniiH+LZcxIjDphKvSue2E4SAgNd HGNJEQS4G3OvERG7W0vfFTxoktjed0BS+x77LbnwcSxUGD6qWT7jdVEz2wS4pKjDm8bD VohVPXiKCCWWroonT02FUbprQJkqEKG+/qdTpJ5wwXZn4pl9pw0oX/Fe17ssGKohrPLf UV+1O7g6onNqOC15uHluMg6X+8OnOnLNtuB8BscZD/vWB3jVcHpTqTKXEVLVY9xxKOqC HJeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=MbyzhD24; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a170902f64400b00177568a0e53si4398928plg.252.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=MbyzhD24; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232804AbjAGRX5 (ORCPT + 99 others); Sat, 7 Jan 2023 12:23:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbjAGRXr (ORCPT ); Sat, 7 Jan 2023 12:23:47 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19BF34D701 for ; Sat, 7 Jan 2023 09:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112189; cv=none; d=zohomail.in; s=zohoarc; b=R1iPO5nAJiZPDKgAXCe8tirmOCjKMv243Tph2o+3oQxBCguxY3B9uZrSMA9AnZecehxJlLLWmHFUAU0p//OPhanrYFd1TVNlikt+zGeGPEGT5iCq/YrJGqYQsIqdjH2HMlhk7FaYoZitOyjvelcWHKsjE7jm2f+QP1lVxnP8JqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112189; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=v7XtqjUz6nWh5jT4nFI+X6V58+yGokbG8rQPFlgJWNc=; b=dXMpp6J6d23FQncTgudYXIY/Mjv5x/9zZHHXXA5m/1hv88na5HUOj9QDL9Gnrwx3FwSnTL3cWkcLPtJMzHRzdZJWLX/AvRL2rs7Ae4pGmUaFzpYEVa2ky8OKh4g9p1SeM7GbLiUGWJFd538Ye2ZZd7PWvkN8XdhMUHfhIIKHUP0= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112189; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=v7XtqjUz6nWh5jT4nFI+X6V58+yGokbG8rQPFlgJWNc=; b=MbyzhD244c9NnZc7+uyM5q0J/fZdYhTaLHdc3d67pyokAJU0jfMUPHegUmu5zd6q 4zSWfl0N1MoNPwN97pkpjn/0vSv5G38YW5dWvPLsEOQtaFL5j2KWVE0iQdOlaEi+K/l 2q0euCvB+GwjC1wOm4eEx7LddctHQkU7HtCJttdo= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112188616176.47845568854575; Sat, 7 Jan 2023 22:53:08 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: <0d03a49657c275b784908c0f0b354bb1e40dfed9.1673110890.git.code@siddh.me> Subject: [PATCH v5 06/10] drm: Remove usage of deprecated DRM_DEBUG_DRIVER Date: Sat, 7 Jan 2023 22:52:26 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385412209983316?= X-GMAIL-MSGID: =?utf-8?q?1754385412209983316?= drm_print.h says DRM_DEBUG_DRIVER is deprecated. Thus, use newer drm_dbg_driver(). Also fix the deprecation comment in drm_print.h which mentions drm_dbg() instead of drm_dbg_driver(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_mipi_dbi.c | 10 +++++----- include/drm/drm_print.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 58ff9503a403..ab5dd5933a1a 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -70,11 +70,11 @@ #define MIPI_DBI_DEBUG_COMMAND(cmd, data, len) \ ({ \ if (!len) \ - DRM_DEBUG_DRIVER("cmd=%02x\n", cmd); \ + drm_dbg_driver(NULL, "cmd=%02x\n", cmd); \ else if (len <= 32) \ - DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ + drm_dbg_driver(NULL, "cmd=%02x, par=%*ph\n", cmd, (int)len, data);\ else \ - DRM_DEBUG_DRIVER("cmd=%02x, len=%zu\n", cmd, len); \ + drm_dbg_driver(NULL, "cmd=%02x, len=%zu\n", cmd, len); \ }) static const u8 mipi_dbi_dcs_read_commands[] = { @@ -708,7 +708,7 @@ bool mipi_dbi_display_is_on(struct mipi_dbi *dbi) DCS_POWER_MODE_DISPLAY_NORMAL_MODE | DCS_POWER_MODE_SLEEP_MODE)) return false; - DRM_DEBUG_DRIVER("Display is ON\n"); + drm_dbg_driver(NULL, "Display is ON\n"); return true; } @@ -1256,7 +1256,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *dbi, mutex_init(&dbi->cmdlock); - DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); + drm_dbg_driver(NULL, "SPI speed: %uMHz\n", spi->max_speed_hz / 1000000); return 0; } diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 69ed1d256713..e9435e8a8676 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -617,7 +617,7 @@ void __drm_err(const char *format, ...); #define DRM_DEBUG(fmt, ...) \ __drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__) -/* NOTE: this is deprecated in favor of drm_dbg(NULL, ...). */ +/* NOTE: this is deprecated in favor of drm_dbg_driver(NULL, ...). */ #define DRM_DEBUG_DRIVER(fmt, ...) \ __drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__) From patchwork Sat Jan 7 17:22:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385691wrt; Sat, 7 Jan 2023 09:26:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8h3EV3jGk7mg8NNSOXt9bad46e1fETjpOzQj4HiJ8SzikKlyGgw/1B2UR694jJYUFoIyN X-Received: by 2002:a17:902:d584:b0:192:4ed3:e90c with SMTP id k4-20020a170902d58400b001924ed3e90cmr65657554plh.18.1673112370525; Sat, 07 Jan 2023 09:26:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112370; cv=pass; d=google.com; s=arc-20160816; b=YEGZmVNXpyOz0YMf71SjAIyD6b6o1vy3vGaD9vQeRgbBGkaFcag1dypKZN722rDSsS eD8Z0spNGd9qZQoA36OCqVv9c9BtKvBU4MSuxDJWEh/E/m8WOd+F5MfYp/iX2P2PfxTE tkAt7iTwGkbsnk7MIEj3d78vU9bVScYqc8f9FuiU3Lycu4pmu9C+YXDDjAT782RVQ3h4 OdkU3c09gft/qZ+ZHWj7FfwMuZ3i4kfZS+ctDm3VYiSpZ36Mnl1gJEjxo092Rj4h2JN+ FK+0yQHYMom3Nnv54fEN9EVWHyTh2KHdi6LSC3cK3kN4HZpL9vBA9CtuFEEzjNEDyStq m+Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=gCkVi4PXoHNA8+a5Y4cNFSlM8T5kHx8SQjxhSIxI9lU=; b=ui6+/H7PofkPIu9LwtE5BBRc42lN2NVLk6yxBUqI8fFYevgi2QfOHunulgj8QoFkC9 hNkvKGb52b6KXanKownXOsQnlWPEciHgIS2RqNjnKGWUxpzzDPi4WMFRRW2EDNrSvZB2 nwUX19p+mr0hUTMiRx4ca2o4GhRBrXB+uvj5rwnW7/WXeQeRi53Jp2K4+AMDLzHihQQB iYCccFeX61uL4y9jCF5YXuzi03yy40TwCZ6iupLkRJsKVdFHiOt4qClp4e0OgYqPvoUe rQHnYta1NACldvp7BW9T3DXoTL9rH6jImHZvzplz9tsVCmE5SQimwPKVlf04h/3tYWom slqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=swJIoNu4; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj13-20020a170903048d00b00192fcf07b75si3968854plb.352.2023.01.07.09.25.58; Sat, 07 Jan 2023 09:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=swJIoNu4; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235751AbjAGRYu (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbjAGRYC (ORCPT ); Sat, 7 Jan 2023 12:24:02 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2BA54D718 for ; Sat, 7 Jan 2023 09:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112191; cv=none; d=zohomail.in; s=zohoarc; b=N2Xqk8Z0oDSbi9WEYrSmJcBExjigHKFmq2Slio8jxQQ/Q49ICKabY3Hzclw7KH01DKWURVdwumkkktrQW8hrYo7TN1SC+hI1Tq9FaY3RrzzE4089qLyEL05OschGAP0wJxn87X4G/UvYJDoaIjXqKz7IIVHpZQILve7Wtd9tSpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112191; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=gCkVi4PXoHNA8+a5Y4cNFSlM8T5kHx8SQjxhSIxI9lU=; b=S9KPNaJg1xGyAJylmjZdYdGU6688NAPPF7IyZ0MWM82iQ40GCjJtJajii2wJNywi1r9Z0HXGoJv789V6UaD0lECeaKUE0iZkBNQ5ggYazsn8tG3D0naRYRDeQjR61EY2KaDg3jlp2m8/kdeviY2MWOWjh4GJ48jofsBaXZTkBrw= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112191; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=gCkVi4PXoHNA8+a5Y4cNFSlM8T5kHx8SQjxhSIxI9lU=; b=swJIoNu4zOyxiThr5hvveeb4FRdCG64XP8/tbOVUTKcbQBb6FCguZATn903PL5hg kweEN7Uq848eCG653BZZMsGKiZ3zFPfhAF1lD18Wcx/LYrNS+bkNOpTsmwgWEaI9Cu8 HaAhcjl5z9ODIj/NvYyp3TTDwAAyyhScCBMqBF7A= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112189104735.6261320082903; Sat, 7 Jan 2023 22:53:09 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: <87d69cb612b77f58f110f737996a8f0a9faa2d93.1673110890.git.code@siddh.me> Subject: [PATCH v5 07/10] drm: Remove usage of deprecated DRM_DEBUG_KMS Date: Sat, 7 Jan 2023 22:52:27 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385477104367177?= X-GMAIL-MSGID: =?utf-8?q?1754385477104367177?= drm_print.h says DRM_DEBUG_KMS is deprecated in favor of drm_dbg_kms(). Signed-off-by: Siddh Raman Pant --- drivers/gpu/drm/drm_client_modeset.c | 112 ++++++++++++++----------- drivers/gpu/drm/drm_color_mgmt.c | 4 +- drivers/gpu/drm/drm_connector.c | 21 ++--- drivers/gpu/drm/drm_crtc.c | 36 ++++---- drivers/gpu/drm/drm_crtc_helper.c | 54 ++++++------ drivers/gpu/drm/drm_debugfs_crc.c | 5 +- drivers/gpu/drm/drm_displayid.c | 4 +- drivers/gpu/drm/drm_edid.c | 17 ++-- drivers/gpu/drm/drm_gem_shmem_helper.c | 4 +- drivers/gpu/drm/drm_lease.c | 2 +- drivers/gpu/drm/drm_mipi_dbi.c | 7 +- drivers/gpu/drm/drm_modes.c | 10 +-- drivers/gpu/drm/drm_plane.c | 32 +++---- drivers/gpu/drm/drm_probe_helper.c | 39 ++++----- drivers/gpu/drm/drm_rect.c | 4 +- drivers/gpu/drm/drm_sysfs.c | 8 +- 16 files changed, 189 insertions(+), 170 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index e2403b8c6347..4e08ae688b83 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -242,8 +242,9 @@ static void drm_client_connectors_enabled(struct drm_connector **connectors, for (i = 0; i < connector_count; i++) { connector = connectors[i]; enabled[i] = drm_connector_enabled(connector, true); - DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id, - connector->display_info.non_desktop ? "non desktop" : str_yes_no(enabled[i])); + drm_dbg_kms(connector->dev, "connector %d enabled? %s\n", + connector->base.id, + connector->display_info.non_desktop ? "non desktop" : str_yes_no(enabled[i])); any_enabled |= enabled[i]; } @@ -303,7 +304,7 @@ static bool drm_client_target_cloned(struct drm_device *dev, } if (can_clone) { - DRM_DEBUG_KMS("can clone using command line\n"); + drm_dbg_kms(dev, "can clone using command line\n"); return true; } @@ -328,7 +329,7 @@ static bool drm_client_target_cloned(struct drm_device *dev, } if (can_clone) { - DRM_DEBUG_KMS("can clone using 1024x768\n"); + drm_dbg_kms(dev, "can clone using 1024x768\n"); return true; } drm_info(dev, "kms: can't enable cloning when we probably wanted to.\n"); @@ -352,8 +353,9 @@ static int drm_client_get_tile_offsets(struct drm_connector **connectors, continue; if (!modes[i] && (h_idx || v_idx)) { - DRM_DEBUG_KMS("no modes for connector tiled %d %d\n", i, - connector->base.id); + drm_dbg_kms(connector->dev, + "no modes for connector tiled %d %d\n", + i, connector->base.id); continue; } if (connector->tile_h_loc < h_idx) @@ -364,7 +366,8 @@ static int drm_client_get_tile_offsets(struct drm_connector **connectors, } offsets[idx].x = hoffset; offsets[idx].y = voffset; - DRM_DEBUG_KMS("returned %d %d for %d %d\n", hoffset, voffset, h_idx, v_idx); + drm_dbg_kms(NULL, "returned %d %d for %d %d\n", + hoffset, voffset, h_idx, v_idx); return 0; } @@ -421,14 +424,16 @@ static bool drm_client_target_preferred(struct drm_connector **connectors, drm_client_get_tile_offsets(connectors, connector_count, modes, offsets, i, connector->tile_h_loc, connector->tile_v_loc); } - DRM_DEBUG_KMS("looking for cmdline mode on connector %d\n", - connector->base.id); + drm_dbg_kms(connector->dev, + "looking for cmdline mode on connector %d\n", + connector->base.id); /* got for command line mode first */ modes[i] = drm_connector_pick_cmdline_mode(connector); if (!modes[i]) { - DRM_DEBUG_KMS("looking for preferred mode on connector %d %d\n", - connector->base.id, connector->tile_group ? connector->tile_group->id : 0); + drm_dbg_kms(connector->dev, + "looking for preferred mode on connector %d %d\n", + connector->base.id, connector->tile_group ? connector->tile_group->id : 0); modes[i] = drm_connector_has_preferred_mode(connector, width, height); } /* No preferred modes, pick one off the list */ @@ -450,16 +455,17 @@ static bool drm_client_target_preferred(struct drm_connector **connectors, (connector->tile_h_loc == 0 && connector->tile_v_loc == 0 && !drm_connector_get_tiled_mode(connector))) { - DRM_DEBUG_KMS("Falling back to non tiled mode on Connector %d\n", - connector->base.id); + drm_dbg_kms(connector->dev, + "Falling back to non tiled mode on Connector %d\n", + connector->base.id); modes[i] = drm_connector_fallback_non_tiled_mode(connector); } else { modes[i] = drm_connector_get_tiled_mode(connector); } } - DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name : - "none"); + drm_dbg_kms(connector->dev, "found mode %s\n", + modes[i] ? modes[i]->name : "none"); conn_configured |= BIT_ULL(i); } @@ -619,15 +625,17 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, num_connectors_detected++; if (!enabled[i]) { - DRM_DEBUG_KMS("connector %s not enabled, skipping\n", - connector->name); + drm_dbg_kms(connector->dev, + "connector %s not enabled, skipping\n", + connector->name); conn_configured |= BIT(i); continue; } if (connector->force == DRM_FORCE_OFF) { - DRM_DEBUG_KMS("connector %s is disabled by user, skipping\n", - connector->name); + drm_dbg_kms(connector->dev, + "connector %s is disabled by user, skipping\n", + connector->name); enabled[i] = false; continue; } @@ -637,8 +645,9 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, if (connector->force > DRM_FORCE_OFF) goto bail; - DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", - connector->name); + drm_dbg_kms(connector->dev, + "connector %s has no encoder or crtc, skipping\n", + connector->name); enabled[i] = false; conn_configured |= BIT(i); continue; @@ -655,28 +664,32 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, */ for (j = 0; j < count; j++) { if (crtcs[j] == new_crtc) { - DRM_DEBUG_KMS("fallback: cloned configuration\n"); + drm_dbg_kms(connector->dev, + "fallback: cloned configuration\n"); goto bail; } } - DRM_DEBUG_KMS("looking for cmdline mode on connector %s\n", - connector->name); + drm_dbg_kms(connector->dev, + "looking for cmdline mode on connector %s\n", + connector->name); /* go for command line mode first */ modes[i] = drm_connector_pick_cmdline_mode(connector); /* try for preferred next */ if (!modes[i]) { - DRM_DEBUG_KMS("looking for preferred mode on connector %s %d\n", - connector->name, connector->has_tile); + drm_dbg_kms(connector->dev, + "looking for preferred mode on connector %s %d\n", + connector->name, connector->has_tile); modes[i] = drm_connector_has_preferred_mode(connector, width, height); } /* No preferred mode marked by the EDID? Are there any modes? */ if (!modes[i] && !list_empty(&connector->modes)) { - DRM_DEBUG_KMS("using first mode listed on connector %s\n", - connector->name); + drm_dbg_kms(connector->dev, + "using first mode listed on connector %s\n", + connector->name); modes[i] = list_first_entry(&connector->modes, struct drm_display_mode, head); @@ -695,8 +708,9 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, * This is crtc->mode and not crtc->state->mode for the * fastboot check to work correctly. */ - DRM_DEBUG_KMS("looking for current mode on connector %s\n", - connector->name); + drm_dbg_kms(connector->dev, + "looking for current mode on connector %s\n", + connector->name); modes[i] = &connector->state->crtc->mode; } /* @@ -705,18 +719,20 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, */ if (connector->has_tile && num_tiled_conns < connector->num_h_tile * connector->num_v_tile) { - DRM_DEBUG_KMS("Falling back to non tiled mode on Connector %d\n", - connector->base.id); + drm_dbg_kms(connector->dev, + "Falling back to non tiled mode on Connector %d\n", + connector->base.id); modes[i] = drm_connector_fallback_non_tiled_mode(connector); } crtcs[i] = new_crtc; - DRM_DEBUG_KMS("connector %s on [CRTC:%d:%s]: %dx%d%s\n", - connector->name, - connector->state->crtc->base.id, - connector->state->crtc->name, - modes[i]->hdisplay, modes[i]->vdisplay, - modes[i]->flags & DRM_MODE_FLAG_INTERLACE ? "i" : ""); + drm_dbg_kms(connector->dev, + "connector %s on [CRTC:%d:%s]: %dx%d%s\n", + connector->name, + connector->state->crtc->base.id, + connector->state->crtc->name, + modes[i]->hdisplay, modes[i]->vdisplay, + modes[i]->flags & DRM_MODE_FLAG_INTERLACE ? "i" : ""); fallback = false; conn_configured |= BIT(i); @@ -732,15 +748,15 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, */ if (num_connectors_enabled != num_connectors_detected && num_connectors_enabled < dev->mode_config.num_crtc) { - DRM_DEBUG_KMS("fallback: Not all outputs enabled\n"); - DRM_DEBUG_KMS("Enabled: %i, detected: %i\n", num_connectors_enabled, - num_connectors_detected); + drm_dbg_kms(NULL, "fallback: Not all outputs enabled\n"); + drm_dbg_kms(NULL, "Enabled: %i, detected: %i\n", + num_connectors_enabled, num_connectors_detected); fallback = true; } if (fallback) { bail: - DRM_DEBUG_KMS("Not using firmware configuration\n"); + drm_dbg_kms(NULL, "Not using firmware configuration\n"); memcpy(enabled, save_enabled, count); ret = false; } @@ -777,7 +793,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, int i, ret = 0; bool *enabled; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(dev, "\n"); if (!width) width = dev->mode_config.max_width; @@ -819,7 +835,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, for (i = 0; i < connector_count; i++) total_modes_count += connectors[i]->funcs->fill_modes(connectors[i], width, height); if (!total_modes_count) - DRM_DEBUG_KMS("No connectors reported connected with modes\n"); + drm_dbg_kms(dev, "No connectors reported connected with modes\n"); drm_client_connectors_enabled(connectors, connector_count, enabled); if (!drm_client_firmware_config(client, connectors, connector_count, crtcs, @@ -834,8 +850,8 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, offsets, enabled, width, height)) drm_err(client->dev, "Unable to find initial modes\n"); - DRM_DEBUG_KMS("picking CRTCs for %dx%d config\n", - width, height); + drm_dbg_kms(dev, "picking CRTCs for %dx%d config\n", + width, height); drm_client_pick_crtcs(client, connectors, connector_count, crtcs, modes, 0, width, height); @@ -853,8 +869,8 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, struct drm_mode_set *modeset = drm_client_find_modeset(client, crtc); struct drm_connector *connector = connectors[i]; - DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n", - mode->name, crtc->base.id, offset->x, offset->y); + drm_dbg_kms(dev, "desired mode %s set on crtc %d (%d,%d)\n", + mode->name, crtc->base.id, offset->x, offset->y); if (WARN_ON_ONCE(modeset->num_connectors == DRM_CLIENT_MAX_CLONED_CONNECTORS || (dev->mode_config.num_crtc > 1 && modeset->num_connectors == 1))) { diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c index d021497841b8..a2761a6ce11f 100644 --- a/drivers/gpu/drm/drm_color_mgmt.c +++ b/drivers/gpu/drm/drm_color_mgmt.c @@ -612,7 +612,7 @@ int drm_color_lut_check(const struct drm_property_blob *lut, u32 tests) if (tests & DRM_COLOR_LUT_EQUAL_CHANNELS) { if (entry[i].red != entry[i].blue || entry[i].red != entry[i].green) { - DRM_DEBUG_KMS("All LUT entries must have equal r/g/b\n"); + drm_dbg_kms(NULL, "All LUT entries must have equal r/g/b\n"); return -EINVAL; } } @@ -621,7 +621,7 @@ int drm_color_lut_check(const struct drm_property_blob *lut, u32 tests) if (entry[i].red < entry[i - 1].red || entry[i].green < entry[i - 1].green || entry[i].blue < entry[i - 1].blue) { - DRM_DEBUG_KMS("LUT entries must never decrease.\n"); + drm_dbg_kms(NULL, "LUT entries must never decrease.\n"); return -EINVAL; } } diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 6e962ad565db..67413e242b6e 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -178,13 +178,14 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector) mode->panel_orientation); } - DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n", - connector->name, mode->name, - mode->xres, mode->yres, - mode->refresh_specified ? mode->refresh : 60, - mode->rb ? " reduced blanking" : "", - mode->margins ? " with margins" : "", - mode->interlace ? " interlaced" : ""); + drm_dbg_kms(connector->dev, + "cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n", + connector->name, mode->name, + mode->xres, mode->yres, + mode->refresh_specified ? mode->refresh : 60, + mode->rb ? " reduced blanking" : "", + mode->margins ? " with margins" : "", + mode->interlace ? " interlaced" : ""); } static void drm_connector_free(struct kref *kref) @@ -244,9 +245,9 @@ static int __drm_connector_init(struct drm_device *dev, /* connector index is used with 32bit bitmasks */ ret = ida_alloc_max(&config->connector_ida, 31, GFP_KERNEL); if (ret < 0) { - DRM_DEBUG_KMS("Failed to allocate %s connector index: %d\n", - drm_connector_enum_list[connector_type].name, - ret); + drm_dbg_kms(dev, "Failed to allocate %s connector index: %d\n", + drm_connector_enum_list[connector_type].name, + ret); goto out_put; } connector->index = ret; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index df9bf3c9206e..adc426561e17 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -730,10 +730,10 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, crtc = drm_crtc_find(dev, file_priv, crtc_req->crtc_id); if (!crtc) { - DRM_DEBUG_KMS("Unknown CRTC ID %d\n", crtc_req->crtc_id); + drm_dbg_kms(dev, "Unknown CRTC ID %d\n", crtc_req->crtc_id); return -ENOENT; } - DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); + drm_dbg_kms(dev, "[CRTC:%d:%s]\n", crtc->base.id, crtc->name); plane = crtc->primary; @@ -756,7 +756,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, old_fb = plane->fb; if (!old_fb) { - DRM_DEBUG_KMS("CRTC doesn't have current FB\n"); + drm_dbg_kms(dev, "CRTC doesn't have current FB\n"); ret = -EINVAL; goto out; } @@ -767,8 +767,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, } else { fb = drm_framebuffer_lookup(dev, file_priv, crtc_req->fb_id); if (!fb) { - DRM_DEBUG_KMS("Unknown FB ID%d\n", - crtc_req->fb_id); + drm_dbg_kms(dev, "Unknown FB ID%d\n", crtc_req->fb_id); ret = -ENOENT; goto out; } @@ -781,7 +780,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, } if (!file_priv->aspect_ratio_allowed && (crtc_req->mode.flags & DRM_MODE_FLAG_PIC_AR_MASK) != DRM_MODE_FLAG_PIC_AR_NONE) { - DRM_DEBUG_KMS("Unexpected aspect-ratio flag bits\n"); + drm_dbg_kms(dev, "Unexpected aspect-ratio flag bits\n"); ret = -EINVAL; goto out; } @@ -789,8 +788,8 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, ret = drm_mode_convert_umode(dev, mode, &crtc_req->mode); if (ret) { - DRM_DEBUG_KMS("Invalid mode (ret=%d, status=%s)\n", - ret, drm_get_mode_status_name(mode->status)); + drm_dbg_kms(dev, "Invalid mode (ret=%d, status=%s)\n", + ret, drm_get_mode_status_name(mode->status)); drm_mode_debug_printmodeline(mode); goto out; } @@ -807,9 +806,8 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, fb->format->format, fb->modifier); if (ret) { - DRM_DEBUG_KMS("Invalid pixel format %p4cc, modifier 0x%llx\n", - &fb->format->format, - fb->modifier); + drm_dbg_kms(dev, "Invalid pixel format %p4cc, modifier 0x%llx\n", + &fb->format->format, fb->modifier); goto out; } } @@ -822,14 +820,14 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, } if (crtc_req->count_connectors == 0 && mode) { - DRM_DEBUG_KMS("Count connectors is 0 but mode set\n"); + drm_dbg_kms(dev, "Count connectors is 0 but mode set\n"); ret = -EINVAL; goto out; } if (crtc_req->count_connectors > 0 && (!mode || !fb)) { - DRM_DEBUG_KMS("Count connectors is %d but no mode or fb set\n", - crtc_req->count_connectors); + drm_dbg_kms(dev, "Count connectors is %d but no mode or fb set\n", + crtc_req->count_connectors); ret = -EINVAL; goto out; } @@ -861,14 +859,14 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, connector = drm_connector_lookup(dev, file_priv, out_id); if (!connector) { - DRM_DEBUG_KMS("Connector id %d unknown\n", - out_id); + drm_dbg_kms(dev, "Connector id %d unknown\n", + out_id); ret = -ENOENT; goto out; } - DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", - connector->base.id, - connector->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s]\n", + connector->base.id, + connector->name); connector_set[i] = connector; } diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index b74b4301a471..59e7b86eab93 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -338,7 +338,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, if (encoder_funcs->mode_fixup) { if (!(ret = encoder_funcs->mode_fixup(encoder, mode, adjusted_mode))) { - DRM_DEBUG_KMS("Encoder fixup failed\n"); + drm_dbg_kms(dev, "Encoder fixup failed\n"); goto done; } } @@ -347,11 +347,11 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, if (crtc_funcs->mode_fixup) { if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) { - DRM_DEBUG_KMS("CRTC fixup failed\n"); + drm_dbg_kms(dev, "CRTC fixup failed\n"); goto done; } } - DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name); + drm_dbg_kms(dev, "[CRTC:%d:%s]\n", crtc->base.id, crtc->name); drm_mode_copy(&crtc->hwmode, adjusted_mode); @@ -390,8 +390,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, if (!encoder_funcs) continue; - DRM_DEBUG_KMS("[ENCODER:%d:%s] set [MODE:%s]\n", - encoder->base.id, encoder->name, mode->name); + drm_dbg_kms(dev, "[ENCODER:%d:%s] set [MODE:%s]\n", + encoder->base.id, encoder->name, mode->name); if (encoder_funcs->mode_set) encoder_funcs->mode_set(encoder, mode, adjusted_mode); } @@ -567,7 +567,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, int ret; int i; - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(NULL, "\n"); BUG_ON(!set); BUG_ON(!set->crtc); @@ -586,13 +586,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, set->fb = NULL; if (set->fb) { - DRM_DEBUG_KMS("[CRTC:%d:%s] [FB:%d] #connectors=%d (x y) (%i %i)\n", - set->crtc->base.id, set->crtc->name, - set->fb->base.id, - (int)set->num_connectors, set->x, set->y); + drm_dbg_kms(dev, "[CRTC:%d:%s] [FB:%d] #connectors=%d (x y) (%i %i)\n", + set->crtc->base.id, set->crtc->name, + set->fb->base.id, + (int)set->num_connectors, set->x, set->y); } else { - DRM_DEBUG_KMS("[CRTC:%d:%s] [NOFB]\n", - set->crtc->base.id, set->crtc->name); + drm_dbg_kms(dev, "[CRTC:%d:%s] [NOFB]\n", + set->crtc->base.id, set->crtc->name); drm_crtc_helper_disable(set->crtc); return 0; } @@ -642,7 +642,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (set->crtc->primary->fb != set->fb) { /* If we have no fb then treat it as a full mode set */ if (set->crtc->primary->fb == NULL) { - DRM_DEBUG_KMS("crtc has no fb, full mode set\n"); + drm_dbg_kms(dev, "crtc has no fb, full mode set\n"); mode_changed = true; } else if (set->fb->format != set->crtc->primary->fb->format) { mode_changed = true; @@ -654,7 +654,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, fb_changed = true; if (!drm_mode_equal(set->mode, &set->crtc->mode)) { - DRM_DEBUG_KMS("modes are different, full mode set\n"); + drm_dbg_kms(dev, "modes are different, full mode set\n"); drm_mode_debug_printmodeline(&set->crtc->mode); drm_mode_debug_printmodeline(set->mode); mode_changed = true; @@ -690,7 +690,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, fail = 1; if (connector->dpms != DRM_MODE_DPMS_ON) { - DRM_DEBUG_KMS("connector dpms not on, full mode switch\n"); + drm_dbg_kms(dev, "connector dpms not on, full mode switch\n"); mode_changed = true; } @@ -699,7 +699,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, } if (new_encoder != connector->encoder) { - DRM_DEBUG_KMS("encoder changed, full mode switch\n"); + drm_dbg_kms(dev, "encoder changed, full mode switch\n"); mode_changed = true; /* If the encoder is reused for another connector, then * the appropriate crtc will be set later. @@ -740,17 +740,17 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, goto fail; } if (new_crtc != connector->encoder->crtc) { - DRM_DEBUG_KMS("crtc changed, full mode switch\n"); + drm_dbg_kms(dev, "crtc changed, full mode switch\n"); mode_changed = true; connector->encoder->crtc = new_crtc; } if (new_crtc) { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d:%s]\n", - connector->base.id, connector->name, - new_crtc->base.id, new_crtc->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] to [CRTC:%d:%s]\n", + connector->base.id, connector->name, + new_crtc->base.id, new_crtc->name); } else { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [NOCRTC]\n", - connector->base.id, connector->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] to [NOCRTC]\n", + connector->base.id, connector->name); } } drm_connector_list_iter_end(&conn_iter); @@ -761,8 +761,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, if (mode_changed) { if (drm_helper_crtc_in_use(set->crtc)) { - DRM_DEBUG_KMS("attempting to set mode from" - " userspace\n"); + drm_dbg_kms(dev, "attempting to set mode from userspace\n"); drm_mode_debug_printmodeline(set->mode); set->crtc->primary->fb = set->fb; if (!drm_crtc_helper_set_mode(set->crtc, set->mode, @@ -774,10 +773,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, ret = -EINVAL; goto fail; } - DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); + drm_dbg_kms(dev, "Setting connector DPMS state to on\n"); for (i = 0; i < set->num_connectors; i++) { - DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, - set->connectors[i]->name); + drm_dbg_kms(dev, "\t[CONNECTOR:%d:%s] set DPMS on\n", + set->connectors[i]->base.id, + set->connectors[i]->name); set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON); } } diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index a59ef3f0e4a1..f29d286f4760 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -131,8 +131,9 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf, return 0; if (len > PAGE_SIZE - 1) { - DRM_DEBUG_KMS("Expected < %lu bytes into crtc crc control\n", - PAGE_SIZE); + drm_dbg_kms(crtc->dev, + "Expected < %lu bytes into crtc crc control\n", + PAGE_SIZE); return -E2BIG; } diff --git a/drivers/gpu/drm/drm_displayid.c b/drivers/gpu/drm/drm_displayid.c index 67fed6cee9e9..5304ab4337b3 100644 --- a/drivers/gpu/drm/drm_displayid.c +++ b/drivers/gpu/drm/drm_displayid.c @@ -15,8 +15,8 @@ static int validate_displayid(const u8 *displayid, int length, int idx) base = (const struct displayid_header *)&displayid[idx]; - DRM_DEBUG_KMS("base revision 0x%x, length %d, %d %d\n", - base->rev, base->bytes, base->prod_id, base->ext_count); + drm_dbg_kms(NULL, "base revision 0x%x, length %d, %d %d\n", + base->rev, base->bytes, base->prod_id, base->ext_count); /* +1 for DispID checksum */ dispid_length = sizeof(*base) + base->bytes + 1; diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3841aba17abd..ee16ebf88eea 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1987,7 +1987,7 @@ bool drm_edid_block_valid(u8 *_block, int block_num, bool print_bad_edid, status = edid_block_check(block, is_base_block); if (status == EDID_BLOCK_HEADER_REPAIR) { - DRM_DEBUG_KMS("Fixing EDID header, your hardware may be failing\n"); + drm_dbg_kms(NULL, "Fixing EDID header, your hardware may be failing\n"); edid_header_fix(block); /* Retry with fixed header, update status if that worked. */ @@ -2173,8 +2173,9 @@ drm_do_probe_ddc_edid(void *data, u8 *buf, unsigned int block, size_t len) ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers); if (ret == -ENXIO) { - DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n", - adapter->name); + drm_dbg_kms(NULL, + "drm: skipping non-existent adapter %s\n", + adapter->name); break; } } while (ret != xfers && --retries); @@ -5629,7 +5630,7 @@ static int _drm_edid_to_sad(const struct drm_edid *drm_edid, } cea_db_iter_end(&iter); - DRM_DEBUG_KMS("Found %d Short Audio Descriptors\n", count); + drm_dbg_kms(NULL, "Found %d Short Audio Descriptors\n", count); return count; } @@ -5674,7 +5675,7 @@ static int _drm_edid_to_speaker_allocation(const struct drm_edid *drm_edid, } cea_db_iter_end(&iter); - DRM_DEBUG_KMS("Found %d Speaker Allocation Data Blocks\n", count); + drm_dbg_kms(NULL, "Found %d Speaker Allocation Data Blocks\n", count); return count; } @@ -5801,7 +5802,7 @@ static bool _drm_detect_monitor_audio(const struct drm_edid *drm_edid) drm_edid_iter_end(&edid_iter); if (has_audio) { - DRM_DEBUG_KMS("Monitor has basic audio support\n"); + drm_dbg_kms(NULL, "Monitor has basic audio support\n"); goto end; } @@ -5812,8 +5813,8 @@ static bool _drm_detect_monitor_audio(const struct drm_edid *drm_edid) int i; for (i = 0; i < cea_db_payload_len(db); i += 3) - DRM_DEBUG_KMS("CEA audio format %d\n", - (data[i] >> 3) & 0xf); + drm_dbg_kms(NULL, "CEA audio format %d\n", + (data[i] >> 3) & 0xf); has_audio = true; break; } diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index db73234edcbe..e99426b5be93 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -175,7 +175,7 @@ static int drm_gem_shmem_get_pages_locked(struct drm_gem_shmem_object *shmem) pages = drm_gem_get_pages(obj); if (IS_ERR(pages)) { - DRM_DEBUG_KMS("Failed to get pages (%ld)\n", PTR_ERR(pages)); + drm_dbg_kms(NULL, "Failed to get pages (%ld)\n", PTR_ERR(pages)); shmem->pages_use_count = 0; return PTR_ERR(pages); } @@ -328,7 +328,7 @@ static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem, } if (ret) { - DRM_DEBUG_KMS("Failed to vmap pages, error %d\n", ret); + drm_dbg_kms(NULL, "Failed to vmap pages, error %d\n", ret); goto err_put_pages; } diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index a4b50fdbaaf7..c442d5e766d1 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -400,7 +400,7 @@ static int fill_object_idr(struct drm_device *dev, } if (!drm_mode_object_lease_required(objects[o]->type)) { - DRM_DEBUG_KMS("invalid object for lease\n"); + drm_dbg_kms(dev, "invalid object for lease\n"); ret = -EINVAL; goto out_free_objects; } diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index ab5dd5933a1a..793fdd7da1d0 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -265,7 +265,8 @@ static void mipi_dbi_fb_dirty(struct iosys_map *src, struct drm_framebuffer *fb, full = width == fb->width && height == fb->height; - DRM_DEBUG_KMS("Flushing [FB:%d] " DRM_RECT_FMT "\n", fb->base.id, DRM_RECT_ARG(rect)); + drm_dbg_kms(fb->dev, "Flushing [FB:%d] " DRM_RECT_FMT "\n", + fb->base.id, DRM_RECT_ARG(rect)); if (!dbi->dc || !full || swap || fb->format->format == DRM_FORMAT_XRGB8888) { @@ -408,7 +409,7 @@ void mipi_dbi_pipe_disable(struct drm_simple_display_pipe *pipe) { struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); - DRM_DEBUG_KMS("\n"); + drm_dbg_kms(&dbidev->drm, "\n"); if (dbidev->backlight) backlight_disable(dbidev->backlight); @@ -627,7 +628,7 @@ int mipi_dbi_dev_init_with_formats(struct mipi_dbi_dev *dbidev, drm->mode_config.max_height = dbidev->mode.vdisplay; dbidev->rotation = rotation; - DRM_DEBUG_KMS("rotation = %u\n", rotation); + drm_dbg_kms(drm, "rotation = %u\n", rotation); return 0; } diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index cc6d1f216e78..cebd2fd83e3e 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -52,11 +52,11 @@ * drm_mode_debug_printmodeline - print a mode to dmesg * @mode: mode to print * - * Describe @mode using DRM_DEBUG. + * Describe @mode using drm_dbg_kms(). */ void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) { - DRM_DEBUG_KMS("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); + drm_dbg_kms(NULL, "Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); } EXPORT_SYMBOL(drm_mode_debug_printmodeline); @@ -1812,9 +1812,9 @@ void drm_mode_prune_invalid(struct drm_device *dev, } if (verbose) { drm_mode_debug_printmodeline(mode); - DRM_DEBUG_KMS("Not using %s mode: %s\n", - mode->name, - drm_get_mode_status_name(mode->status)); + drm_dbg_kms(dev, "Not using %s mode: %s\n", + mode->name, + drm_get_mode_status_name(mode->status)); } drm_mode_destroy(dev, mode); } diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 1e8727b7bce9..12fed5f812a1 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -275,7 +275,7 @@ static int __drm_universal_plane_init(struct drm_device *dev, plane->format_types = kmalloc_array(format_count, sizeof(uint32_t), GFP_KERNEL); if (!plane->format_types) { - DRM_DEBUG_KMS("out of memory when allocating plane\n"); + drm_dbg_kms(dev, "out of memory when allocating plane\n"); drm_mode_object_unregister(dev, &plane->base); return -ENOMEM; } @@ -302,7 +302,7 @@ static int __drm_universal_plane_init(struct drm_device *dev, GFP_KERNEL); if (format_modifier_count && !plane->modifiers) { - DRM_DEBUG_KMS("out of memory when allocating plane\n"); + drm_dbg_kms(dev, "out of memory when allocating plane\n"); kfree(plane->format_types); drm_mode_object_unregister(dev, &plane->base); return -ENOMEM; @@ -786,7 +786,7 @@ static int __setplane_check(struct drm_plane *plane, /* Check whether this plane is usable on this CRTC */ if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) { - DRM_DEBUG_KMS("Invalid crtc for plane\n"); + drm_dbg_kms(plane->dev, "Invalid crtc for plane\n"); return -EINVAL; } @@ -794,8 +794,9 @@ static int __setplane_check(struct drm_plane *plane, ret = drm_plane_check_pixel_format(plane, fb->format->format, fb->modifier); if (ret) { - DRM_DEBUG_KMS("Invalid pixel format %p4cc, modifier 0x%llx\n", - &fb->format->format, fb->modifier); + drm_dbg_kms(fb->dev, + "Invalid pixel format %p4cc, modifier 0x%llx\n", + &fb->format->format, fb->modifier); return ret; } @@ -804,8 +805,8 @@ static int __setplane_check(struct drm_plane *plane, crtc_x > INT_MAX - (int32_t) crtc_w || crtc_h > INT_MAX || crtc_y > INT_MAX - (int32_t) crtc_h) { - DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n", - crtc_w, crtc_h, crtc_x, crtc_y); + drm_dbg_kms(crtc->dev, "Invalid CRTC coordinates %ux%u+%d+%d\n", + crtc_w, crtc_h, crtc_x, crtc_y); return -ERANGE; } @@ -982,24 +983,23 @@ int drm_mode_setplane(struct drm_device *dev, void *data, */ plane = drm_plane_find(dev, file_priv, plane_req->plane_id); if (!plane) { - DRM_DEBUG_KMS("Unknown plane ID %d\n", - plane_req->plane_id); + drm_dbg_kms(dev, "Unknown plane ID %d\n", plane_req->plane_id); return -ENOENT; } if (plane_req->fb_id) { fb = drm_framebuffer_lookup(dev, file_priv, plane_req->fb_id); if (!fb) { - DRM_DEBUG_KMS("Unknown framebuffer ID %d\n", - plane_req->fb_id); + drm_dbg_kms(dev, "Unknown framebuffer ID %d\n", + plane_req->fb_id); return -ENOENT; } crtc = drm_crtc_find(dev, file_priv, plane_req->crtc_id); if (!crtc) { drm_framebuffer_put(fb); - DRM_DEBUG_KMS("Unknown crtc ID %d\n", - plane_req->crtc_id); + drm_dbg_kms(dev, "Unknown crtc ID %d\n", + plane_req->crtc_id); return -ENOENT; } } @@ -1048,7 +1048,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc, if (req->handle) { fb = drm_internal_framebuffer_create(dev, &fbreq, file_priv); if (IS_ERR(fb)) { - DRM_DEBUG_KMS("failed to wrap cursor buffer in drm framebuffer\n"); + drm_dbg_kms(dev, "failed to wrap cursor buffer in drm framebuffer\n"); return PTR_ERR(fb); } @@ -1119,7 +1119,7 @@ static int drm_mode_cursor_common(struct drm_device *dev, crtc = drm_crtc_find(dev, file_priv, req->crtc_id); if (!crtc) { - DRM_DEBUG_KMS("Unknown CRTC ID %d\n", req->crtc_id); + drm_dbg_kms(dev, "Unknown CRTC ID %d\n", req->crtc_id); return -ENOENT; } @@ -1340,7 +1340,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, * to modifier changes. */ if (old_fb->format->format != fb->format->format) { - DRM_DEBUG_KMS("Page flip is not allowed to change frame buffer format.\n"); + drm_dbg_kms(dev, "Page flip is not allowed to change frame buffer format.\n"); ret = -EINVAL; goto out; } diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 7973f2589ced..37a114e6f065 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -504,8 +504,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, drm_modeset_acquire_init(&ctx, 0); - DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, - connector->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s]\n", connector->base.id, + connector->name); retry: ret = drm_modeset_lock(&dev->mode_config.connection_mutex, &ctx); @@ -548,11 +548,12 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, * check here, and if anything changed start the hotplug code. */ if (old_status != connector->status) { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n", - connector->base.id, - connector->name, - drm_get_connector_status_name(old_status), - drm_get_connector_status_name(connector->status)); + drm_dbg_kms(dev, + "[CONNECTOR:%d:%s] status updated from %s to %s\n", + connector->base.id, + connector->name, + drm_get_connector_status_name(old_status), + drm_get_connector_status_name(connector->status)); /* * The hotplug event code might call into the fb @@ -573,8 +574,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, dev->mode_config.poll_running = drm_kms_helper_poll; if (connector->status == connector_status_disconnected) { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", - connector->base.id, connector->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] disconnected\n", + connector->base.id, connector->name); drm_connector_update_edid_property(connector, NULL); drm_mode_prune_invalid(dev, &connector->modes, false); goto exit; @@ -632,8 +633,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, drm_mode_sort(&connector->modes); - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id, - connector->name); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] probed modes :\n", + connector->base.id, connector->name); list_for_each_entry(mode, &connector->modes, head) { drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); drm_mode_debug_printmodeline(mode); @@ -764,14 +765,14 @@ static void output_poll_execute(struct work_struct *work) old = drm_get_connector_status_name(old_status); new = drm_get_connector_status_name(connector->status); - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] " - "status updated from %s to %s\n", - connector->base.id, - connector->name, - old, new); - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n", - connector->base.id, connector->name, - old_epoch_counter, connector->epoch_counter); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] " + "status updated from %s to %s\n", + connector->base.id, + connector->name, + old, new); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] epoch counter %llu -> %llu\n", + connector->base.id, connector->name, + old_epoch_counter, connector->epoch_counter); changed = true; } diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c index 85c79a38c13a..8f4abcb1cbd8 100644 --- a/drivers/gpu/drm/drm_rect.c +++ b/drivers/gpu/drm/drm_rect.c @@ -228,9 +228,9 @@ EXPORT_SYMBOL(drm_rect_calc_vscale); void drm_rect_debug_print(const char *prefix, const struct drm_rect *r, bool fixed_point) { if (fixed_point) - DRM_DEBUG_KMS("%s" DRM_RECT_FP_FMT "\n", prefix, DRM_RECT_FP_ARG(r)); + drm_dbg_kms(NULL, "%s" DRM_RECT_FP_FMT "\n", prefix, DRM_RECT_FP_ARG(r)); else - DRM_DEBUG_KMS("%s" DRM_RECT_FMT "\n", prefix, DRM_RECT_ARG(r)); + drm_dbg_kms(NULL, "%s" DRM_RECT_FMT "\n", prefix, DRM_RECT_ARG(r)); } EXPORT_SYMBOL(drm_rect_debug_print); diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index ee810d493b6e..df6ca2ab0d3b 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -178,10 +178,10 @@ static ssize_t status_store(struct device *device, ret = -EINVAL; if (old_force != connector->force || !connector->force) { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] force updated from %d to %d or reprobing\n", - connector->base.id, - connector->name, - old_force, connector->force); + drm_dbg_kms(dev, "[CONNECTOR:%d:%s] force updated from %d to %d or reprobing\n", + connector->base.id, + connector->name, + old_force, connector->force); connector->funcs->fill_modes(connector, dev->mode_config.max_width, From patchwork Sat Jan 7 17:22:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385215wrt; Sat, 7 Jan 2023 09:25:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8lcv4MvWY1Wx0IhYX4EBAqbRpCDLx9JCQjlAwLgCD4dlgawrbYMMMJB1M3gfFjltke4Xq X-Received: by 2002:a05:6a21:3288:b0:af:d0d7:9f42 with SMTP id yt8-20020a056a21328800b000afd0d79f42mr86792843pzb.22.1673112308914; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=xzP2Bml6Z4MW1HEqX16Prb/AlL3RfLxUyzgkAFzWpQnpCK4khVPQTAZ0kIvUT/2Cj2 NoTyVUcKH5x19vow2NK1jV95AEzUCTY5ec8kCobM9wJXGrnM0REsBBsaYZFjzHJUrPjX WcyZhhVGcDVVOkaDoXhm4zwXMwFDBV6ZaDTyW8Hhxwscq9FF3T5WwLFuqqMMGBYUvkFP z01ZItmWL9C7wM3LrlXKkxcl0ZAPOtTatJ4xOyb3YA04HxHWmTaylJNuo/7/gRC7pkNg 73zPKI9NbLE2jJwOEhC4C6H4ZBPRhxma+kyLQqfDRaZqwF9y0kAsuCkfg8U/2+RTBbAN cdmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=YAXTlBSpddAOoRl/rgdcXT/UmQnPneK4iAsjBbqHVFE=; b=YsMWKniAbombM5tRI8wEuVQeErT1ETLqWIbP4/G8VXB7jXJXNmMSC+fXSlo8GbwhMv VBOJfLKT3/BPVQ8KOQaCc1Ci2V99ZVNjcvvjgcFLoST4h91DHot4goAW5wbBpYMVs/X5 iYZQCtkMxd8csx0/npgTmKv74MZhWZg6yZ+tAmfsmGzHiU4MV1bKUTDloZfMAbzjGggL 7+vgzkJb9/VGswmt2XGqOaXQ10GHMLVPxZ2mBOJkcEhakC6l9c+IgC/bo3YA3MhMQdok zOgxC3VteWIUbJGNJ9uEBby8i8wskaisWCLLoNz4wxMWXGrMnmfnBV4kdhkuxyo46sY8 Jwzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="eFmF/hSf"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a63df18000000b00496731929d6si4753388pgg.780.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b="eFmF/hSf"; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbjAGRYa (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232647AbjAGRXt (ORCPT ); Sat, 7 Jan 2023 12:23:49 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593694C72F for ; Sat, 7 Jan 2023 09:23:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112190; cv=none; d=zohomail.in; s=zohoarc; b=R1mrQ4F3Ue9uLmF3hdVCIJGqIdNH8yLqxX66hcHQOzS2jo9KAJtR8rJ8KxqdRm6/0y7B5tsyfpR4ijFC2DeQMxOE3rGVTVz1GDwwlOaeunm1/d8c4gMB2WH3LnNNahHtwlF/fbLRrvelnbcsWPUBOsMsJMKpdb1gn9zjid7m7Wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=YAXTlBSpddAOoRl/rgdcXT/UmQnPneK4iAsjBbqHVFE=; b=OnnVbJ5KJ+wIunl2sbKSWbrAGYCwROtMWP8kEGPrAfSzt0x4O/l7vNeAbVSXSVkM9q0HF0hEc7MqswXyOiYbAzXw85bN9NAW6Js44KjYQmqH66+rXJpTGKJVZXs0xxPXhvn9LG3OnKbKKhA6EUD/tf3Jlei1LGOXS2kYO/PkXr4= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112190; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=YAXTlBSpddAOoRl/rgdcXT/UmQnPneK4iAsjBbqHVFE=; b=eFmF/hSfTGZhghmBExiaqdRIEOVPdMaYRmH5DEnHpjbwgxoRmq1fHZDTkX3Rmh8z Le8UbLTSaxcoiSm5dkOynm7sMe4BIGaywSWNeu37zagqc0TeSZnUSRwmZ++WdEmCL/n 5uA2gxbJVJDXx0gwEw3Hyr/as9polEdQ7QuVD/BM= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112189539240.16651329667513; Sat, 7 Jan 2023 22:53:09 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: <775e3800eed1f62df950063dc623037ca3840828.1673110890.git.code@siddh.me> Subject: [PATCH v5 08/10] drm: Remove usage of deprecated DRM_DEBUG_PRIME Date: Sat, 7 Jan 2023 22:52:28 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385412712471845?= X-GMAIL-MSGID: =?utf-8?q?1754385412712471845?= drm_print.h says DRM_DEBUG_PRIME is deprecated in favor of drm_dbg_prime(). Signed-off-by: Siddh Raman Pant Reviewed-by: Simon Ser --- drivers/gpu/drm/drm_gem_dma_helper.c | 4 ++-- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c index 1ba551b0ab97..0f903cc8914a 100644 --- a/drivers/gpu/drm/drm_gem_dma_helper.c +++ b/drivers/gpu/drm/drm_gem_dma_helper.c @@ -477,8 +477,8 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev, dma_obj->dma_addr = sg_dma_address(sgt->sgl); dma_obj->sgt = sgt; - DRM_DEBUG_PRIME("dma_addr = %pad, size = %zu\n", &dma_obj->dma_addr, - attach->dmabuf->size); + drm_dbg_prime(dev, "dma_addr = %pad, size = %zu\n", &dma_obj->dma_addr, + attach->dmabuf->size); return &dma_obj->base; } diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index e99426b5be93..c8780b72e4e8 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -760,7 +760,7 @@ drm_gem_shmem_prime_import_sg_table(struct drm_device *dev, shmem->sgt = sgt; - DRM_DEBUG_PRIME("size = %zu\n", size); + drm_dbg_prime(dev, "size = %zu\n", size); return &shmem->base; } From patchwork Sat Jan 7 17:22:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40420 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1385213wrt; Sat, 7 Jan 2023 09:25:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXsZOv0dsOUG8EgOTHjn3SiXp9LQNUWvLnShmxuqJvdgJFMr0XskTeXnbslyEsDZ2cEHDDsI X-Received: by 2002:a17:902:ab85:b0:192:f469:5283 with SMTP id f5-20020a170902ab8500b00192f4695283mr13439031plr.3.1673112308719; Sat, 07 Jan 2023 09:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673112308; cv=pass; d=google.com; s=arc-20160816; b=f7udtOnmPdZYItNf+D+xg/PCmjyvhkT7jDvcib3A+bym72+Rofh8IEeRScagrxfoX/ n3DKN+604IEuzHn0DowamK5TwQ+Mup1yQi3/JwK1unRiE4e/duHQ6fXK7e9jGhgFBMGT M1eav/sT0A9SV/4Bs/jCA7bk4xljSe64fFIhGqXxc5XKTRKR8cTVDx74ulckVtN0fOWz 25QS5vbW+SkiEFmUQq5FrNA3QDTV6NJ5YREXS8Gd048I5m9t7SS15V36CnkHl5tHCwRx v5+yIY0isf4/TV4AKyTsFHMgBOD6j6iKD/njZYV5XD5FXp+k1Hg3by/j+LYdw1GKN+jo gt2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=vDU7G83TY944n7aJ7AYG6c6+m7Oj3HDIQ3X/IYcsZW0=; b=y1aZjXiJlCbKXjSGHCX206w+3Cg05q6CE2Ch4/aWiREGP9iLtGzVScXawZuF0genNv LdQuFUlT+3PDNeg7IkbDRnz63rI1d/76PHOQ01rer9xYLbh7zWn5/uavTzS//q3awPli KsXRRrYz9Ykc04aF0/HDS3W9VPY4QcpqsNf0c/bQhwHj5Uppto7uAg+/PEQJ0EUmx/Pt HByawxdRBBRiO1Yu0UoZXoaYjXUncAfuCP2fDuoW9BsXX8IMUiFkfs40jORnE8dYDUr1 +BRtHRG+/tyMItDZwH1jEuWD8wRr76ME1NUcscCRHX3knkp7hVtCh75WNZZSF+rQuk5y KtnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=kINyEyP9; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a170902708600b001842f465c10si4144280plk.438.2023.01.07.09.24.54; Sat, 07 Jan 2023 09:25:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=kINyEyP9; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232774AbjAGRYf (ORCPT + 99 others); Sat, 7 Jan 2023 12:24:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232609AbjAGRXv (ORCPT ); Sat, 7 Jan 2023 12:23:51 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637074D483 for ; Sat, 7 Jan 2023 09:23:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112190; cv=none; d=zohomail.in; s=zohoarc; b=GlWiU6ZxclryKvwhjks2+3VUiR3MsGc2506CbSsMTIjnuHRpg+yDsVyYl6TfBgkF9puns7pC4QcuHo5414Z0jXyfoPAimxotQHYzhEAWY029ugxca9zGj/CLwe+owIDtAnMF2AKOpjsPmtYI9wGYQHjdViq5VOaqm9ZJiicuTpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=vDU7G83TY944n7aJ7AYG6c6+m7Oj3HDIQ3X/IYcsZW0=; b=OYNMDUFeDzzgXx7YFUr0QqZXAVXLvVZRD2hYYF4v0iBY2XA5XIaOv/Rm+r/cVIRg2Rp51apwJTTLPRQEogdTxkXD5nK2FHvipwE/YZUYIaObjO2vEpTw+xcQ3sl3kgrTZDi0nDM1zV7xoabJxYmfDGVqHOYgJgSHrZ6z7tOey/g= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112190; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=vDU7G83TY944n7aJ7AYG6c6+m7Oj3HDIQ3X/IYcsZW0=; b=kINyEyP9m+UHRbI5SzDkbdoHwdWBtDycxr44ZKWHR5aHDB7wpA5ofJbCU7wbHnO+ NUTzcvtOKqwtogBVYbTSHweFrxvnwy8cRkEd+2WePzpU9Rek/a8uJxQU+Ktfx+uxmA8 dtH0rOqLGpHKnvvuMHL32UcPD+xP6f5gFY1SRrzU= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112189995790.9263747834939; Sat, 7 Jan 2023 22:53:09 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v5 09/10] drm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC Date: Sat, 7 Jan 2023 22:52:29 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754385411708837561?= X-GMAIL-MSGID: =?utf-8?q?1754385411708837561?= drm_print.h says DRM_DEBUG_ATOMIC is deprecated in favor of drm_dbg_atomic(). Signed-off-by: Siddh Raman Pant Reviewed-by: Simon Ser --- drivers/gpu/drm/drm_blend.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index b4c8cab7158c..6e74de833466 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -450,8 +450,8 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, int i, n = 0; int ret = 0; - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n", - crtc->base.id, crtc->name); + drm_dbg_atomic(dev, "[CRTC:%d:%s] calculating normalized zpos values\n", + crtc->base.id, crtc->name); states = kmalloc_array(total_planes, sizeof(*states), GFP_KERNEL); if (!states) @@ -469,9 +469,8 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, goto done; } states[n++] = plane_state; - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] processing zpos value %d\n", - plane->base.id, plane->name, - plane_state->zpos); + drm_dbg_atomic(dev, "[PLANE:%d:%s] processing zpos value %d\n", + plane->base.id, plane->name, plane_state->zpos); } sort(states, n, sizeof(*states), drm_atomic_state_zpos_cmp, NULL); @@ -480,8 +479,8 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc, plane = states[i]->plane; states[i]->normalized_zpos = i; - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] normalized zpos value %d\n", - plane->base.id, plane->name, i); + drm_dbg_atomic(dev, "[PLANE:%d:%s] normalized zpos value %d\n", + plane->base.id, plane->name, i); } crtc_state->zpos_changed = true; From patchwork Sat Jan 7 17:22:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddh Raman Pant X-Patchwork-Id: 40427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1391586wrt; Sat, 7 Jan 2023 09:42:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuL28unlS3UtgXgbyK1VjogSRqi1R6m8ppgrbSVRrMzQ+933sq24cRehx+0qCLihoVw/Qg4 X-Received: by 2002:a05:6a20:6a83:b0:ab:fe5a:df95 with SMTP id bi3-20020a056a206a8300b000abfe5adf95mr64003085pzb.15.1673113346382; Sat, 07 Jan 2023 09:42:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673113346; cv=pass; d=google.com; s=arc-20160816; b=csHYDOQLcnE2cTTL/n+J6p017TGBndCn/ouiGoHGq/XMebjfAyRiF3Qqn15tAZVo7L RmuZWWNcgBH1laSvFBbQB/VhU+5ylSz51dZeg2qTNe0wGQsGY6uHTkak9yr0fn4AsaQm dK3ESIi6z4onUOZl8BHtjxACgeuJLENKv+03W8NepAy65hVjLSawUlBUqQOwE//YfGxA 4Syf6ZkZk3GA2aWd6KdVZspUAmHwMyfhdJLo6OuZWK2YxJ8N2cHXZFiPO8cMAhLME/oA q7wHBni/XgaUgg58DBdMJl6uKs4QSqNkLvZFBcgoEVARhoH7dpawfiFiJvOF7QLQz0lX bgrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=4B/yhGIoBjfbicria+SnqvD0RZrkccqeOcCw0+ipmeg=; b=vf1rc/5B7GEHBib17GFwzOHhZbpvGzHfBy5LXNz+aLODJbBXoZgn/ohjPRRQYJ+Y+Y nToSIXZ4TaRjqXDYYmIS233HB83pb+Vl2xUrtX6t4hqicsBWeD4F4RqTK+mF2//E8B/+ 1QzreX2ClCGK/DNQ+zXGu4N2RKKYUr+fU2r/lYKnqt03/SxTa+OWl1aIRe6uLrRQPCoK TMlCLBeaGXc4YNc1qy6tAFIR0TjjMjWnfoEqw5EBM2ysDFrqLMWO7gMMjTMOZ2Bcj8sH uRwgvlbuE0AS3pOTxwgt4oTddYmLwoPvLe4xZu90xgsfNKXlARgXrkiw4QF20gZjIWj9 bqYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=i6+6PGK+; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a6563d0000000b004a42c8c3793si4551880pgv.509.2023.01.07.09.42.13; Sat, 07 Jan 2023 09:42:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=i6+6PGK+; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232850AbjAGR0x (ORCPT + 99 others); Sat, 7 Jan 2023 12:26:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232830AbjAGR0V (ORCPT ); Sat, 7 Jan 2023 12:26:21 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 481B64D73A for ; Sat, 7 Jan 2023 09:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673112192; cv=none; d=zohomail.in; s=zohoarc; b=OvJ/K1tYG9hrdhNSFaZhuNFES0p5ZVbnbuofdK0Vf7V6TpS7x4DxktgL1/cynCo5h5Ia4g+pcUl7Dg8fQvkCl1OPEwkv47fv91vyCsW7bSU0mEwY5rwMfk4NDKLbNQCbFfKA0kcnqN8NbfVTHNqCi39WMU43sR9HfMZDf+xgcDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673112192; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=4B/yhGIoBjfbicria+SnqvD0RZrkccqeOcCw0+ipmeg=; b=Ih5VfdGZWWJ/lqFZQEDBvDPnAoXJRWSHd7IKPUT96/o5HrbKIAZkgT5BZtXDLrGt4P9KG/lE9H4ZT73pC6dUz58rN9I8vug0FzSNiW+ktHiB+g+s8MNWAiswXYyeO15nab5fB3MXRG8Y14aYwJVjUZ6uExt0grLwG6aqSf0gW+k= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1673112192; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=4B/yhGIoBjfbicria+SnqvD0RZrkccqeOcCw0+ipmeg=; b=i6+6PGK+w7l/HhrUNhQ1WoycvuRU2Wm24uLeyRFkHu9AzwimY63c/LDverKKoNNf NnnM+lqkmd7e7Abl6o8WpSAbeAD4ZTmWcmdLrhpVk1bVkbr9yxL1rSAtoMuZX0IKnOr N+EoQ0siZFIBJgR/ePW7/bfog6lkxMVI/XKYL/gU= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673112190429279.6322489615774; Sat, 7 Jan 2023 22:53:10 +0530 (IST) From: Siddh Raman Pant To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Simon Ser , Jim Cromie Cc: dri-devel , linux-kernel Message-ID: Subject: [PATCH v5 10/10] drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE Date: Sat, 7 Jan 2023 22:52:30 +0530 X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754386500371129587?= X-GMAIL-MSGID: =?utf-8?q?1754386500371129587?= drm_print.h says DRM_DEBUG_LEASE is deprecated in favor of drm_dbg_lease(). Signed-off-by: Siddh Raman Pant Reviewed-by: Simon Ser --- drivers/gpu/drm/drm_lease.c | 64 ++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index c442d5e766d1..08b4f29f8b61 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -213,11 +213,11 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr int id; void *entry; - DRM_DEBUG_LEASE("lessor %d\n", lessor->lessee_id); + drm_dbg_lease(dev, "lessor %d\n", lessor->lessee_id); lessee = drm_master_create(lessor->dev); if (!lessee) { - DRM_DEBUG_LEASE("drm_master_create failed\n"); + drm_dbg_lease(dev, "drm_master_create failed\n"); return ERR_PTR(-ENOMEM); } @@ -231,7 +231,7 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr error = -EBUSY; if (error != 0) { - DRM_DEBUG_LEASE("object %d failed %d\n", object, error); + drm_dbg_lease(dev, "object %d failed %d\n", object, error); goto out_lessee; } } @@ -249,7 +249,8 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr /* Move the leases over */ lessee->leases = *leases; - DRM_DEBUG_LEASE("new lessee %d %p, lessor %d %p\n", lessee->lessee_id, lessee, lessor->lessee_id, lessor); + drm_dbg_lease(dev, "new lessee %d %p, lessor %d %p\n", + lessee->lessee_id, lessee, lessor->lessee_id, lessor); mutex_unlock(&dev->mode_config.idr_mutex); return lessee; @@ -268,7 +269,7 @@ void drm_lease_destroy(struct drm_master *master) mutex_lock(&dev->mode_config.idr_mutex); - DRM_DEBUG_LEASE("drm_lease_destroy %d\n", master->lessee_id); + drm_dbg_lease(dev, "drm_lease_destroy %d\n", master->lessee_id); /* This master is referenced by all lessees, hence it cannot be destroyed * until all of them have been @@ -277,7 +278,8 @@ void drm_lease_destroy(struct drm_master *master) /* Remove this master from the lessee idr in the owner */ if (master->lessee_id != 0) { - DRM_DEBUG_LEASE("remove master %d from device list of lessees\n", master->lessee_id); + drm_dbg_lease(dev, "remove master %d from device list of lessees\n", + master->lessee_id); idr_remove(&(drm_lease_owner(master)->lessee_idr), master->lessee_id); } @@ -292,7 +294,7 @@ void drm_lease_destroy(struct drm_master *master) drm_master_put(&master->lessor); } - DRM_DEBUG_LEASE("drm_lease_destroy done %d\n", master->lessee_id); + drm_dbg_lease(dev, "drm_lease_destroy done %d\n", master->lessee_id); } static void _drm_lease_revoke(struct drm_master *top) @@ -308,7 +310,8 @@ static void _drm_lease_revoke(struct drm_master *top) * the tree is fully connected, we can do this without recursing */ for (;;) { - DRM_DEBUG_LEASE("revoke leases for %p %d\n", master, master->lessee_id); + drm_dbg_lease(master->dev, "revoke leases for %p %d\n", + master, master->lessee_id); /* Evacuate the lease */ idr_for_each_entry(&master->leases, entry, object) @@ -408,7 +411,7 @@ static int fill_object_idr(struct drm_device *dev, ret = validate_lease(dev, object_count, objects, universal_planes); if (ret) { - DRM_DEBUG_LEASE("lease validation failed\n"); + drm_dbg_lease(dev, "lease validation failed\n"); goto out_free_objects; } @@ -418,7 +421,7 @@ static int fill_object_idr(struct drm_device *dev, struct drm_mode_object *obj = objects[o]; u32 object_id = objects[o]->id; - DRM_DEBUG_LEASE("Adding object %d to lease\n", object_id); + drm_dbg_lease(dev, "Adding object %d to lease\n", object_id); /* * We're using an IDR to hold the set of leased @@ -430,8 +433,8 @@ static int fill_object_idr(struct drm_device *dev, */ ret = idr_alloc(leases, &drm_lease_idr_object , object_id, object_id + 1, GFP_KERNEL); if (ret < 0) { - DRM_DEBUG_LEASE("Object %d cannot be inserted into leases (%d)\n", - object_id, ret); + drm_dbg_lease(dev, "Object %d cannot be inserted into leases (%d)\n", + object_id, ret); goto out_free_objects; } if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) { @@ -439,15 +442,15 @@ static int fill_object_idr(struct drm_device *dev, ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL); if (ret < 0) { - DRM_DEBUG_LEASE("Object primary plane %d cannot be inserted into leases (%d)\n", - object_id, ret); + drm_dbg_lease(dev, "Object primary plane %d cannot be inserted into leases (%d)\n", + object_id, ret); goto out_free_objects; } if (crtc->cursor) { ret = idr_alloc(leases, &drm_lease_idr_object, crtc->cursor->base.id, crtc->cursor->base.id + 1, GFP_KERNEL); if (ret < 0) { - DRM_DEBUG_LEASE("Object cursor plane %d cannot be inserted into leases (%d)\n", - object_id, ret); + drm_dbg_lease(dev, "Object cursor plane %d cannot be inserted into leases (%d)\n", + object_id, ret); goto out_free_objects; } } @@ -490,14 +493,14 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, return -EOPNOTSUPP; if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) { - DRM_DEBUG_LEASE("invalid flags\n"); + drm_dbg_lease(dev, "invalid flags\n"); return -EINVAL; } lessor = drm_file_get_master(lessor_priv); /* Do not allow sub-leases */ if (lessor->lessor) { - DRM_DEBUG_LEASE("recursive leasing not allowed\n"); + drm_dbg_lease(dev, "recursive leasing not allowed\n"); ret = -EINVAL; goto out_lessor; } @@ -520,7 +523,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, object_count, object_ids); kfree(object_ids); if (ret) { - DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret); + drm_dbg_lease(dev, "lease object lookup failed: %i\n", ret); idr_destroy(&leases); goto out_lessor; } @@ -534,7 +537,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, goto out_lessor; } - DRM_DEBUG_LEASE("Creating lease\n"); + drm_dbg_lease(dev, "Creating lease\n"); /* lessee will take the ownership of leases */ lessee = drm_lease_create(lessor, &leases); @@ -545,7 +548,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, } /* Clone the lessor file to create a new file for us */ - DRM_DEBUG_LEASE("Allocating lease file\n"); + drm_dbg_lease(dev, "Allocating lease file\n"); lessee_file = file_clone_open(lessor_file); if (IS_ERR(lessee_file)) { ret = PTR_ERR(lessee_file); @@ -560,7 +563,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, lessee_priv->authenticated = 1; /* Pass fd back to userspace */ - DRM_DEBUG_LEASE("Returning fd %d id %d\n", fd, lessee->lessee_id); + drm_dbg_lease(dev, "Returning fd %d id %d\n", fd, lessee->lessee_id); cl->fd = fd; cl->lessee_id = lessee->lessee_id; @@ -568,7 +571,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, fd_install(fd, lessee_file); drm_master_put(&lessor); - DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n"); + drm_dbg_lease(dev, "drm_mode_create_lease_ioctl succeeded\n"); return 0; out_lessee: @@ -579,7 +582,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, out_lessor: drm_master_put(&lessor); - DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl failed: %d\n", ret); + drm_dbg_lease(dev, "drm_mode_create_lease_ioctl failed: %d\n", ret); return ret; } @@ -601,7 +604,7 @@ int drm_mode_list_lessees_ioctl(struct drm_device *dev, return -EOPNOTSUPP; lessor = drm_file_get_master(lessor_priv); - DRM_DEBUG_LEASE("List lessees for %d\n", lessor->lessee_id); + drm_dbg_lease(dev, "List lessees for %d\n", lessor->lessee_id); mutex_lock(&dev->mode_config.idr_mutex); @@ -610,7 +613,8 @@ int drm_mode_list_lessees_ioctl(struct drm_device *dev, /* Only list un-revoked leases */ if (!idr_is_empty(&lessee->leases)) { if (count_lessees > count) { - DRM_DEBUG_LEASE("Add lessee %d\n", lessee->lessee_id); + drm_dbg_lease(dev, "Add lessee %d\n", + lessee->lessee_id); ret = put_user(lessee->lessee_id, lessee_ids + count); if (ret) break; @@ -619,7 +623,7 @@ int drm_mode_list_lessees_ioctl(struct drm_device *dev, } } - DRM_DEBUG_LEASE("Lessor leases to %d\n", count); + drm_dbg_lease(dev, "Lessor leases to %d\n", count); if (ret == 0) arg->count_lessees = count; @@ -651,7 +655,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, return -EOPNOTSUPP; lessee = drm_file_get_master(lessee_priv); - DRM_DEBUG_LEASE("get lease for %d\n", lessee->lessee_id); + drm_dbg_lease(dev, "get lease for %d\n", lessee->lessee_id); mutex_lock(&dev->mode_config.idr_mutex); @@ -665,7 +669,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, count = 0; idr_for_each_entry(object_idr, entry, object) { if (count_objects > count) { - DRM_DEBUG_LEASE("adding object %d\n", object); + drm_dbg_lease(dev, "adding object %d\n", object); ret = put_user(object, object_ids + count); if (ret) break; @@ -696,7 +700,7 @@ int drm_mode_revoke_lease_ioctl(struct drm_device *dev, struct drm_master *lessee; int ret = 0; - DRM_DEBUG_LEASE("revoke lease for %d\n", arg->lessee_id); + drm_dbg_lease(dev, "revoke lease for %d\n", arg->lessee_id); /* Can't lease without MODESET */ if (!drm_core_check_feature(dev, DRIVER_MODESET))