From nobody Tue Dec 2 02:51:16 2025 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A05A628853E for ; Tue, 18 Nov 2025 11:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763463700; cv=none; b=eeEehS3ieOJXdAzBKbKr3hHo62VpsjeCszFpnSeRWZzQno+4WSur8KcTcp0STJ4LnEOo1KP/U1icKEP5yQfRgiIi73ZZ9K26VgQjFYim6jco+G3k2QVcbEmHZg55SidzFlhRqJHobTbxA1ohu1HchmOap0zKbXsgtVt6PGq8EqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763463700; c=relaxed/simple; bh=iJ5HwfFddOZfZVyAeaBaF9p3Oq4JdPOEYQ6qc4uhHy8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IrGylc3QO4S5LJeIpF+mNUnDNcemzRpvh2YZv2O5VHRmT1fRDmOJQR8fAzcG88JhI5DiUjz0Bn/Y60JVeSyNN0Fd16Sl8kxgLPLz47hwo5so+GeBTOl6EWzowCOz+LU1umC9bOBTiCiHq35WZ8ExlAMK8/gjabSQBonPJZyiYy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kISRw6uk; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kISRw6uk" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-29808a9a96aso56274645ad.1 for ; Tue, 18 Nov 2025 03:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763463698; x=1764068498; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EVmPZwhrzesKcBYZl5KHgQBjgPr6W3bZdX9iA2XOIqs=; b=kISRw6uktDs8azoHkjYhK+quM4CvcegeKOHzjlkbJR5XQ+MuN04841ROMOySYqlJKS kQcOJ8jXVx0ZimFQbRz43BJwHixUJD0fBVnFlrZV60/Y6aOwJbDUyL8nart06FI9+lyO RDKVRk+LlH+3iU8shCzs7bfVJk0+/r1cUwPIMs1bxcyzJiPZP3uByV1/fjqaRz12uB0F hPknz2dYAXO2ON9VVAKw9KECAGZM4yPv0YHNMF/7NDjqxUgNFFbQRntdaj8m/CHWclJI WUmA0UJwEEeXypSsstD6XJAa6q0zZfhf1pEQO+X5o+T7l6fNhINpdORnj+UWWOI2xQnf H72A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763463698; x=1764068498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EVmPZwhrzesKcBYZl5KHgQBjgPr6W3bZdX9iA2XOIqs=; b=EeYws/FUsejd7a0ThK8m8aQjMx1DCIiMEn646dCkzzXBM086oUa7w5kCWoXwxQFcJ7 z9gX7gCf5cvchQk4/dKltfhZjR18SlRV65jzcejSnX1hNzJMv+T4WcZsnT+lrIbeVpFV y2eCVaDAWI08KYxIl2ZKoMZNMfjp7DL8J2sWT0emMZsov7Kwrg0aWYFKVDHQfqLWe/8i a/s0OVOiB47M8+Tpxye6kMPF+06K3rvL89VU65UX2RbHblM94dKmYy6eLjGfNKL71KDq nPb2jimUTWheX6NuIzDh/1ng1nwIKE4/JiI1Q0fU36RL2yCkV83tHExLr6BNJOTev7nv 7/SQ== X-Forwarded-Encrypted: i=1; AJvYcCV2Wkup6UhKlwGpuFvXAWUJSsazeMpAeqrGYIjbIvlN1A7FJENsfHN8RIW6RjnzPGWyCiskSp2dyroa8aA=@vger.kernel.org X-Gm-Message-State: AOJu0YwBIiEH6paoZLsibmxwog70n0No//C7j88GzdO8uFg8NZ5CzN55 liMoHtmxu2gzdofjgDqJRYY1soZyZit4FfvEBzP1RFHm89Crgxr3DnIj X-Gm-Gg: ASbGncse++17a9ohTAKeGN0JuXeaEDpxeApC/eGP0eh0YB6A9+thEMkNxjV6T66ONZK h+LK4UT5miiiSyOXFUVdIxUQk70GrWoSpoB8ovvyFgqb0aPYk7UDrmAQ43PBYbuFz/ED3ysNNk3 f44XyPOyrRbYJQ401sc8ye+eAHz+7F8urVkzuxBsLw3rMcsLOhY0NU6CPuvQHhUY/hLrJHXP0Pq q3FMzP5hIk9YVKaJauEzKmZUPRBJvi9/sdacDDiT6XdmVg5jNG46e5QO0osjWU+2BuRWQl+BjLn vkPNKGqNeeqsRYUHeJ/b9s9+SEtE3j8OJaL/Opcn3jFpEKf+qBf53uzwAob3zODFVXzKN3vZKaT Jiko1Jpb936Ns5F/TCBUvJC29rclRnt6lklyEiWnRgsK+UUWI8lsOiAFL7fSDflrjbBV1fpf/3I 1EED4S4qnLo3SuKk8wjuIrvL+pMqKFywW1v8c= X-Google-Smtp-Source: AGHT+IE8r9XdpKJ0leW+FWYFvXVO0vUNmqhHEgDh0Jf9mkhR8NYeZWMhMlicbcCwcsfqmv9mbei48w== X-Received: by 2002:a17:903:2f86:b0:297:c71d:851c with SMTP id d9443c01a7336-2986a73ba82mr199327545ad.36.1763463697635; Tue, 18 Nov 2025 03:01:37 -0800 (PST) Received: from rahul-mintos.ban-spse ([165.204.156.251]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2985c241f89sm168012035ad.28.2025.11.18.03.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 03:01:37 -0800 (PST) From: Rahul Kumar To: liviu.dudau@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, rk0006818@gmail.com Subject: [PATCH v2 2/3] drm/komeda: Convert logging in komeda_pipeline.c to drm_* with drm_device parameter Date: Tue, 18 Nov 2025 16:29:33 +0530 Message-ID: <20251118105934.748955-3-rk0006818@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251118105934.748955-1-rk0006818@gmail.com> References: <20251118105934.748955-1-rk0006818@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace DRM_ERROR/WARN/INFO() and DRM_DEBUG() calls in drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c with the drm_err(), drm_warn(), drm_info() and drm_dbg() helpers. The drm_*() logging macros require a struct drm_device * parameter, which allows the DRM core to prefix log messages with the device instance. This is important for distinguishing logs when multiple Komeda or other DRM devices are present. This conversion follows the DRM TODO entry: "Convert logging to drm_* functions with drm_device parameter". Signed-off-by: Rahul Kumar --- Changes since v1: - Fixed incorrect use of dev_get_drvdata(): it returns struct komeda_drv *, not struct komeda_kms_dev *, as pointed out by Liviu Dudau. - Updated DRM device pointer retrieval to use drv->kms. - Combined both changes into a 0/3 series. Link to v1: https://lore.kernel.org/all/aRcKzbV_cKbC6vlV@e110455-lin.cambridge.arm.com/ --- .../drm/arm/display/komeda/komeda_pipeline.c | 61 +++++++++++++------ 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers= /gpu/drm/arm/display/komeda/komeda_pipeline.c index 81e244f0c0ca..0d1f870c31d9 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c @@ -12,22 +12,26 @@ #include "komeda_dev.h" #include "komeda_kms.h" #include "komeda_pipeline.h" +#include "komeda_drv.h" =20 /** komeda_pipeline_add - Add a pipeline to &komeda_dev */ struct komeda_pipeline * komeda_pipeline_add(struct komeda_dev *mdev, size_t size, const struct komeda_pipeline_funcs *funcs) { + struct komeda_drv *drv =3D dev_get_drvdata(mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_pipeline *pipe; =20 if (mdev->n_pipelines + 1 > KOMEDA_MAX_PIPELINES) { - DRM_ERROR("Exceed max support %d pipelines.\n", - KOMEDA_MAX_PIPELINES); + drm_err(drm, "Exceed max support %d pipelines.\n", + KOMEDA_MAX_PIPELINES); return ERR_PTR(-ENOSPC); } =20 if (size < sizeof(*pipe)) { - DRM_ERROR("Request pipeline size too small.\n"); + drm_err(drm, "Request pipeline size too small.\n"); return ERR_PTR(-EINVAL); } =20 @@ -71,6 +75,9 @@ static struct komeda_component ** komeda_pipeline_get_component_pos(struct komeda_pipeline *pipe, int id) { struct komeda_dev *mdev =3D pipe->mdev; + struct komeda_drv *drv =3D dev_get_drvdata(mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_pipeline *temp =3D NULL; struct komeda_component **pos =3D NULL; =20 @@ -88,7 +95,7 @@ komeda_pipeline_get_component_pos(struct komeda_pipeline = *pipe, int id) case KOMEDA_COMPONENT_COMPIZ1: temp =3D mdev->pipelines[id - KOMEDA_COMPONENT_COMPIZ0]; if (!temp) { - DRM_ERROR("compiz-%d doesn't exist.\n", id); + drm_err(drm, "compiz-%d doesn't exist.\n", id); return NULL; } pos =3D to_cpos(temp->compiz); @@ -107,7 +114,7 @@ komeda_pipeline_get_component_pos(struct komeda_pipelin= e *pipe, int id) case KOMEDA_COMPONENT_IPS1: temp =3D mdev->pipelines[id - KOMEDA_COMPONENT_IPS0]; if (!temp) { - DRM_ERROR("ips-%d doesn't exist.\n", id); + drm_err(drm, "ips-%d doesn't exist.\n", id); return NULL; } pos =3D to_cpos(temp->improc); @@ -117,7 +124,7 @@ komeda_pipeline_get_component_pos(struct komeda_pipelin= e *pipe, int id) break; default: pos =3D NULL; - DRM_ERROR("Unknown pipeline resource ID: %d.\n", id); + drm_err(drm, "Unknown pipeline resource ID: %d.\n", id); break; } =20 @@ -169,6 +176,9 @@ komeda_component_add(struct komeda_pipeline *pipe, u8 max_active_outputs, u32 __iomem *reg, const char *name_fmt, ...) { + struct komeda_drv *drv =3D dev_get_drvdata(pipe->mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_component **pos; struct komeda_component *c; int idx, *num =3D NULL; @@ -187,14 +197,14 @@ komeda_component_add(struct komeda_pipeline *pipe, idx =3D id - KOMEDA_COMPONENT_LAYER0; num =3D &pipe->n_layers; if (idx !=3D pipe->n_layers) { - DRM_ERROR("please add Layer by id sequence.\n"); + drm_err(drm, "please add Layer by id sequence.\n"); return ERR_PTR(-EINVAL); } } else if (has_bit(id, KOMEDA_PIPELINE_SCALERS)) { idx =3D id - KOMEDA_COMPONENT_SCALER0; num =3D &pipe->n_scalers; if (idx !=3D pipe->n_scalers) { - DRM_ERROR("please add Scaler by id sequence.\n"); + drm_err(drm, "please add Scaler by id sequence.\n"); return ERR_PTR(-EINVAL); } } @@ -240,27 +250,34 @@ static void komeda_component_dump(struct komeda_compo= nent *c) if (!c) return; =20 - DRM_DEBUG(" %s: ID %d-0x%08lx.\n", - c->name, c->id, BIT(c->id)); - DRM_DEBUG(" max_active_inputs:%d, supported_inputs: 0x%08x.\n", - c->max_active_inputs, c->supported_inputs); - DRM_DEBUG(" max_active_outputs:%d, supported_outputs: 0x%08x.\n", - c->max_active_outputs, c->supported_outputs); + struct komeda_drv *drv =3D dev_get_drvdata(c->pipeline->mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; + + drm_dbg(drm, " %s: ID %d-0x%08lx.\n", + c->name, c->id, BIT(c->id)); + drm_dbg(drm, " max_active_inputs:%d, supported_inputs: 0x%08x.\n", + c->max_active_inputs, c->supported_inputs); + drm_dbg(drm, " max_active_outputs:%d, supported_outputs: 0x%08x.\n", + c->max_active_outputs, c->supported_outputs); } =20 void komeda_pipeline_dump(struct komeda_pipeline *pipe) { + struct komeda_drv *drv =3D dev_get_drvdata(pipe->mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_component *c; int id; unsigned long avail_comps =3D pipe->avail_comps; =20 - DRM_INFO("Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s.\n", + drm_info(drm, "Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s.\n", pipe->id, pipe->n_layers, pipe->n_scalers, pipe->dual_link ? "dual-link" : "single-link"); - DRM_INFO(" output_link[0]: %s.\n", + drm_info(drm, " output_link[0]: %s.\n", pipe->of_output_links[0] ? pipe->of_output_links[0]->full_name : "none"); - DRM_INFO(" output_link[1]: %s.\n", + drm_info(drm, " output_link[1]: %s.\n", pipe->of_output_links[1] ? pipe->of_output_links[1]->full_name : "none"); =20 @@ -274,6 +291,9 @@ void komeda_pipeline_dump(struct komeda_pipeline *pipe) static void komeda_component_verify_inputs(struct komeda_component *c) { struct komeda_pipeline *pipe =3D c->pipeline; + struct komeda_drv *drv =3D dev_get_drvdata(pipe->mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_component *input; int id; unsigned long supported_inputs =3D c->supported_inputs; @@ -282,7 +302,7 @@ static void komeda_component_verify_inputs(struct komed= a_component *c) input =3D komeda_pipeline_get_component(pipe, id); if (!input) { c->supported_inputs &=3D ~(BIT(id)); - DRM_WARN("Can not find input(ID-%d) for component: %s.\n", + drm_warn(drm, "Can not find input(ID-%d) for component: %s.\n", id, c->name); continue; } @@ -306,6 +326,9 @@ komeda_get_layer_split_right_layer(struct komeda_pipeli= ne *pipe, =20 static void komeda_pipeline_assemble(struct komeda_pipeline *pipe) { + struct komeda_drv *drv =3D dev_get_drvdata(pipe->mdev->dev); + struct komeda_kms_dev *kms =3D drv->kms; + struct drm_device *drm =3D &kms->base; struct komeda_component *c; struct komeda_layer *layer; int i, id; @@ -324,7 +347,7 @@ static void komeda_pipeline_assemble(struct komeda_pipe= line *pipe) =20 if (pipe->dual_link && !pipe->ctrlr->supports_dual_link) { pipe->dual_link =3D false; - DRM_WARN("PIPE-%d doesn't support dual-link, ignore DT dual-link configu= ration.\n", + drm_warn(drm, "PIPE-%d doesn't support dual-link, ignore DT dual-link co= nfiguration.\n", pipe->id); } } --=20 2.43.0