Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1367531rbb; Mon, 26 Feb 2024 07:12:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlQEyjNpMWbEons82jUKUSTYK6yWbdcXsCxTcv2HAXnMEl43UfRSYYlbVpovzdYnVlml8OcO1avmPQkeCRZKErZBgEA8W8uKpeBojaaQ== X-Google-Smtp-Source: AGHT+IEzNqetiexMWye+UHeYMKx/VuymslImgVbLFvX5dc1izuxb/VxmRNSG8JuPlczTBx//DIwW X-Received: by 2002:a17:90a:5918:b0:299:5bd3:42c3 with SMTP id k24-20020a17090a591800b002995bd342c3mr4863230pji.43.1708960352695; Mon, 26 Feb 2024 07:12:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708960352; cv=pass; d=google.com; s=arc-20160816; b=UIxAWtBiCP1GKeH3H4Emo4o/lCtKzl5MkYnTe4oWu3tkNDdILoTVZVI9P0ep3avWDI raMGuYqI2Hv1+7k4Kirnm6qQKc6gWLytZqXgzM+9x1418+mdWypkeZQZb0BmEaimQ/E/ n/ImjgZg4uZbpR/3BQiy/jGvgASQtf6nlDQcCR4WT6ZgoRE27LOFjFHI2tTu0Y4UFbfA bezXGdjHazNdTYprfH2vAwyknEQ2eUHwjdDB8okajeO863gFyp7bXmiDEbqh89ZlVtJF BNQN62tB/GapzqHOnucqh20qpJZOjMGA9uafN93hNVae7fhwOH3Of781Ek33XPqch+jQ iKaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=pHFPjafoUUyEEPYk2er5+KvcLp5nedQAUortwOQE9tE=; fh=URPIQrmzO0XhTZnCnyk5e8wKy1PuZ46Qn/NOSJPvptQ=; b=lrkOYGcTSnT6PdJ0RLynjLglQhQGtF6CroRklvbbQERvx5jDSoKwWh0eZ49fUYmCS0 kmudqrvnqYa09nVh/Iart4dTeViP/2MiVy/poi49U7eE1JybWUFA8LSHZr6EqmES+YH0 LucVQomIR14xik1+kIkWMv9LbnEest2RYsbUP4qJ0phUzCujip1e5RaEYmOj4adpWFbC v5loJJFU4l9PawyRZoCXs4nEUTyrtILqq5q/iOtYJtcNKoGPdNzCKwFbGcfVkScqDKdG 3pEFlIvM9cBy80wSt++dMQrIJqXci2kqt3C2wObWLfZSkvn0S95WgHx7Rd+32eogA8Et KUjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e6L8ztEn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81748-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i18-20020a17090ad35200b002992d6d513esi5718826pjx.147.2024.02.26.07.12.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81748-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e6L8ztEn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-81748-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81748-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6437729D972 for ; Mon, 26 Feb 2024 15:12:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC73112A176; Mon, 26 Feb 2024 14:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="e6L8ztEn" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E41F012AAC4 for ; Mon, 26 Feb 2024 14:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708959486; cv=none; b=f5ByEcKzUCCwGfYjojJYIkizT75PPnRylTN/nbE0VWc96oRfN7bq6YWWyHlFyCpHgqIN2ljRLhtwHpZirCqd5WoE18r977Hk56h8ztEbIu/Y5CQ5Zyor649mpXsascdghGmT+D/2fJPyyFMYUE8+CjkTRhr0z49asSFpgdbSQgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708959486; c=relaxed/simple; bh=kL0QfoZ6P1nfZ64PEp9mANVk6/r8ms3ZNTWK9icE4ik=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Q4TdyK29W2eZHnHe5eJjKiKpy3S7cZqBqnxAU3jxFhFXDScXxi4TwmjELPrCKBTwCphJeLjM82ZteQ7KSmMc8hTr4lS677M2+Pv0rrU1/X19xDKeNXr1s6tzLE4P8NqHFulZuitkdWJ6HRiueUJ/osHwMkSVd9H06iaXkP1CTEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=e6L8ztEn; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708959484; x=1740495484; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=kL0QfoZ6P1nfZ64PEp9mANVk6/r8ms3ZNTWK9icE4ik=; b=e6L8ztEnfrjbFDgT2SvwQsGnlokWbjEKWc42tBgi7I1hDhgns1YBLwK9 TA6Y64cCO8OH6Yip6qmyZ0WNKequavAYpFOK4mNI72lO7bp4jgqZeYs6H ydjvM09Gp5KTaz8v4Rwk5XDFkH23wmJLLov5y0RQj05X16u8y7FcyJj+i P2wbo76pG/DU6H0A/2uUctc1cscRqSSxTAXzsy7KQGsN2FvE+t0xML/aT 3IkobQsg3uPRur9V52MhDbM8Z6uCkyqRfUt2XQgd33qsskk4VmMeECTap 60+LAJqz5MQ+K6y8pbW/1r17JReASzsUzgcYudX4mrB8n4G/2C6T6MtiO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="3119372" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="3119372" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 06:58:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="37482087" Received: from hibeid-mobl.amr.corp.intel.com (HELO localhost) ([10.252.46.254]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 06:57:58 -0800 From: Jani Nikula To: Ville =?utf-8?B?U3lyasOkbMOk?= , Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org, Petr Mladek , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/12] drm/i915: Indicate which pipe failed the fastset check overall In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240215164055.30585-1-ville.syrjala@linux.intel.com> <20240215164055.30585-2-ville.syrjala@linux.intel.com> Date: Mon, 26 Feb 2024 16:57:58 +0200 Message-ID: <87bk83mfwp.fsf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, 23 Feb 2024, Ville Syrj=C3=A4l=C3=A4 wrote: > On Thu, Feb 22, 2024 at 04:46:12PM -0500, Rodrigo Vivi wrote: >> On Thu, Feb 15, 2024 at 06:40:44PM +0200, Ville Syrjala wrote: >> > From: Ville Syrj=C3=A4l=C3=A4 >> >=20 >> > intel_crtc_check_fastset() is done per-pipe, so it would be nice >> > to know which pipe it was that failed its checkup. >> >=20 >> > Signed-off-by: Ville Syrj=C3=A4l=C3=A4 >> > --- >> > drivers/gpu/drm/i915/display/intel_display.c | 6 ++++-- >> > 1 file changed, 4 insertions(+), 2 deletions(-) >> >=20 >> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gp= u/drm/i915/display/intel_display.c >> > index 00ac65a14029..a7f487f5c2b2 100644 >> > --- a/drivers/gpu/drm/i915/display/intel_display.c >> > +++ b/drivers/gpu/drm/i915/display/intel_display.c >> > @@ -5562,14 +5562,16 @@ static int intel_modeset_checks(struct intel_a= tomic_state *state) >> > static void intel_crtc_check_fastset(const struct intel_crtc_state *o= ld_crtc_state, >> > struct intel_crtc_state *new_crtc_state) >> > { >> > - struct drm_i915_private *i915 =3D to_i915(old_crtc_state->uapi.crtc-= >dev); >> > + struct intel_crtc *crtc =3D to_intel_crtc(new_crtc_state->uapi.crtc); >> > + struct drm_i915_private *i915 =3D to_i915(crtc->base.dev); >> >=20=20 >> > /* only allow LRR when the timings stay within the VRR range */ >> > if (old_crtc_state->vrr.in_range !=3D new_crtc_state->vrr.in_range) >> > new_crtc_state->update_lrr =3D false; >> >=20=20 >> > if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true)) >> > - drm_dbg_kms(&i915->drm, "fastset requirement not met, forcing full = modeset\n"); >> > + drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] fastset requirement not met, = forcing full modeset\n", >> > + crtc->base.base.id, crtc->base.name); >>=20 >> looking to other patches in this same series, I wonder >> if we shouldn't benefit of a crct_dbg(crtc, "message") that would print >> [CRTC:%d:%s] underneath. > > There has been some discussion on this topic recently, but > I don't think that particular approach is good because: > a) it only works when you need to talk about one partiuclar > object and often we need to talk about more than one > b) different debug function for every little thing is just ugly, > and we'd probably end up with dozens of differently named > variants which takes up too many slots in my brain's pattern > matcher Agreed. I dislike the approach in i915 gem and xe drivers. There are just too many logging variants now, and as the gates are open, more are coming. Please let's not go there with display. > I think Jani proposed that drm_dbg_kms() could take different kinds > of objects as its first parameter to do this, but I don't like that > either because of point a). Fair, but arguably that's not as bad, as you'd then have the "main" object you're logging with, the info for that comes for free, and you can add the additional stuff for the other objects manually. But indeed only solves part of the problem. > One idea that was floating about was that each object would embed > a .debug_string or somesuch thing which would include the preferred > formatting. With that you could prints with just a simple %s. The > downside is that when you then read the format string you have no > idea what kind of thing each %s refers to unless you also parse > the full argument list to figure out which is which. Also, that would have to be a fixed string, initialized at object creation. Can't have a function returning the string, because it gets complicated with C. > And one basic idea I was mulling over at some point was simply > to define DRM_CRTC_FMT/ARGS/etc. macros and use those. But that > makes the format string super ugly and hard to read. Agreed. > I think the proper solution would be to have actually > sensible conversion specifiers in the format string. > So instead of % we'd have something > more like %{drm_crtc} (or whatever color you want to throw > on that particular bikeshed). Personally I suck at remembering even the standard printf conversion specifiers, let alone all the kernel extensions. I basically have to look them up every time. I'd really love some %{name} format for named pointer things. And indeed preferrably without the %p. Just %{name}. And then we could discuss adding support for drm specific things. I guess one downside is that the functions to do this would have to be in vsprintf.c instead of drm. Unless we add some code in drm for this that's always built-in. BR, Jani. > > Adding vsprintf.c folks to cc in case they have some ideas... --=20 Jani Nikula, Intel