Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 652C6C433F5 for ; Tue, 30 Nov 2021 08:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239663AbhK3Ilf (ORCPT ); Tue, 30 Nov 2021 03:41:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234779AbhK3Ile (ORCPT ); Tue, 30 Nov 2021 03:41:34 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE5CC061574 for ; Tue, 30 Nov 2021 00:38:15 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id r25so18143976edq.7 for ; Tue, 30 Nov 2021 00:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=heplViuVuUTSUcpT2+Fmm0bTuboMvINSnURYbdaCaqQ=; b=B2KGp+GAMKVzg/2mSgXYjc7SNCvlVPjJ6amaerWAvXG4vPqiN3EV8sQTomgILduZ0p K7R8lIAwGoBgxBX7yW9Fn50vb++FmAbR+eR6tBHmPkELDy/5RQQyWkblmJSNtxhM/dWw KiTriQEbBAgobbow9MrcN82Er9dV8iYZhENpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=heplViuVuUTSUcpT2+Fmm0bTuboMvINSnURYbdaCaqQ=; b=Y5g+Hru3z6rxplOYux3LrcrHiY1lP0p6v913l2K5ONpXUAiWTilsB6lZ45+OSrRPvH 0Ekizq/mZ9igmweYfDJsrg8n7zqjBy1D7lDl318c2BfkPLDjeolKxiuBlRsRhXED29wJ NH4206aN5OgK1ymJ1TgpoTzFNMvMsYonBPwwFmdjiQsSvF9lNKOlNqEnjldYT5k6W8Bh h/r1rmkoXbYiasuLK8eptrGuvBAL9QHWWaTkNOp0ThB/NivMQyOAdfnROYjLFCRn5FN7 yRWbzBGa6rMdJMTUiZhf9o0+yTSyZnlw5SUtyt/6bwlGxBAE3NIsuzhpCbIwmmU4i5+L gIIg== X-Gm-Message-State: AOAM533YhfhMegkFhjWi4Lq/WCvlReWo4qknABd/2+h4+Ct2whK+EktX W/8bdsrpjPEKC1dehx0pIYSuAg== X-Google-Smtp-Source: ABdhPJzFUZPOd2k/BSSZubG9ypTkB/vBGosz5jOJWqwCksjMpY207KPkdXOtcPR7IDaf9jugoi6wzg== X-Received: by 2002:a05:6402:2806:: with SMTP id h6mr80656862ede.120.1638261493998; Tue, 30 Nov 2021 00:38:13 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id x7sm12600105edd.28.2021.11.30.00.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 00:38:13 -0800 (PST) Date: Tue, 30 Nov 2021 09:38:11 +0100 From: Daniel Vetter To: Claudio Suarez Cc: dri-devel@lists.freedesktop.org, 0day robot , LKML , lkp@lists.01.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: Re: [PATCH] drm: fix error found in some cases after the patch d1af5cd86997 Message-ID: Mail-Followup-To: Claudio Suarez , dri-devel@lists.freedesktop.org, 0day robot , LKML , lkp@lists.01.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie References: <20211128142015.GB5295@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.10.0-8-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 29, 2021 at 08:27:45PM +0100, Claudio Suarez wrote: > The patch d1af5cd86997 ("drm: get rid of DRM_DEBUG_* log > calls in drm core, files drm_a*.c") fails when the drm_device > cannot be found in the parameter plane_state. Fix it. > > Reported-by: kernel test robot > Fixes: d1af5cd86997 ("drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c") > Signed-off-by: Claudio Suarez > --- > drivers/gpu/drm/drm_atomic_helper.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index aef2fbd676e5..8bd4472d7949 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -312,7 +312,7 @@ update_connector_routing(struct drm_atomic_state *state, > > if (!new_connector_state->crtc) { > drm_dbg_atomic(connector->dev, "Disabling [CONNECTOR:%d:%s]\n", > - connector->base.id, connector->name); > + connector->base.id, connector->name); Can you pls split this checkpatch fix out? > > set_best_encoder(state, new_connector_state, NULL); > > @@ -805,6 +805,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > bool can_update_disabled) > { > struct drm_framebuffer *fb = plane_state->fb; > + struct drm_device *dev = plane_state->plane ? plane_state->plane->dev : NULL; For real drivers plane_state->plane really should never be NULL, and looking at the test report we blow up in an selftest. I think the right fix here is to make the selftest more robust and also mock a drm_plane (with a NULL plane->dev pointer, that should be fine). Can you pls spin that and test it with the selftests enabled in the config? Thanks, Daniel > struct drm_rect *src = &plane_state->src; > struct drm_rect *dst = &plane_state->dst; > unsigned int rotation = plane_state->rotation; > @@ -828,8 +829,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > } > > if (!crtc_state->enable && !can_update_disabled) { > - drm_dbg_kms(plane_state->crtc->dev, > - "Cannot update plane of a disabled CRTC.\n"); > + drm_dbg_kms(dev, "Cannot update plane of a disabled CRTC.\n"); > return -EINVAL; > } > > @@ -839,8 +839,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); > vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); > if (hscale < 0 || vscale < 0) { > - drm_dbg_kms(plane_state->crtc->dev, > - "Invalid scaling of plane\n"); > + drm_dbg_kms(dev, "Invalid scaling of plane\n"); > drm_rect_debug_print("src: ", &plane_state->src, true); > drm_rect_debug_print("dst: ", &plane_state->dst, false); > return -ERANGE; > @@ -864,8 +863,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, > return 0; > > if (!can_position && !drm_rect_equals(dst, &clip)) { > - drm_dbg_kms(plane_state->crtc->dev, > - "Plane must cover entire CRTC\n"); > + drm_dbg_kms(dev, "Plane must cover entire CRTC\n"); > drm_rect_debug_print("dst: ", dst, false); > drm_rect_debug_print("clip: ", &clip, false); > return -EINVAL; > -- > 2.33.0 > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch