Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp298952pxj; Fri, 28 May 2021 04:23:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5ZgZVsbuKN1r5jRcUiLrX6Hcza0JVVnmYfGfo6n3BK/nX6HDVks5bHmhlNYItWa0nk21C X-Received: by 2002:aa7:d607:: with SMTP id c7mr9123041edr.255.1622200984420; Fri, 28 May 2021 04:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622200984; cv=none; d=google.com; s=arc-20160816; b=aidIUWOjHokNH9KoOXZgmnPo+ort9blt5eBw9xGzbGju2jzEc90Xq0y85ntSO3QEyr h2YUag7ZxopaT2IzqplPhzCoKw6nEAPGpvVuCEpfbwS+rfl8CXEc04nV2YGQC3JuMIlF A7gY5AH5R96wdDN3MzSnYKqaca4RAUkZZ7dXBIAtRlUaZYO2926wxqJPLijXGkX0EUo4 7fLYj4HO9yi5iA/iEdeiJ4koTkcwlvhLilTPUUYz2EztsQc8s/Ks1PKLnVusUwu9kU5+ neG7oKj0eBMgrQ/ZBYzTpbgLQTaSbYs4uyHA/SbrFoDf22EPqNLx0Fo0bCTn2tm6I9b9 XzWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from :dkim-signature; bh=zlUZ4FPCmueUwNdjwddPrmOdSMDAIN5yHnfc9LimaJk=; b=ziF1tzmWYrLwST1BHYiep9wWNLjLwUXuFfqCSUAZRjYmsO2L6tuqWhPy69jx4+RJWp ZnDjYJTL2y1qYYECZQAF94fRtvGUAUtxhyu091kAhccJGePgfvBojtS1B2qZmOqcUpgA h2yZPXUJfBhy8NqIMlcGVBZtKGl4H/Gp9HSRtL/WU/DR7R2+O5rBnQ29V62meafQWTPG vfUFTwdVoICPR8Xh691DyPcpP0GuIKd0bMXlF2T5bgRf7wFr0UvsbykfFftT1kLZUxz4 pJIcWJW9QfYJCZLEocZ5/Rd8qV62W8buYZOeYYz6XsAjyjZZqeUBe1uP1s9Lf/PhII8R OdyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=DQpZRYdF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si4552797ejr.271.2021.05.28.04.22.40; Fri, 28 May 2021 04:23:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=DQpZRYdF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235817AbhE1IHQ (ORCPT + 99 others); Fri, 28 May 2021 04:07:16 -0400 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:56477 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbhE1IHN (ORCPT ); Fri, 28 May 2021 04:07:13 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14S82QEb008172; Fri, 28 May 2021 10:05:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : subject : date : message-id : mime-version : content-type; s=selector1; bh=zlUZ4FPCmueUwNdjwddPrmOdSMDAIN5yHnfc9LimaJk=; b=DQpZRYdF3x2GZjYZ/XlPglm9ICNw6a/v8KgxfiXb7wvjWdXjAk/q523nQeUd8FMYQbTj cVrsvoYSHYjdjPZYV9Xkd5jHVbAjXxVbrEYdRY8jykQqOTdcffNpf4nNbGmpVuHQZtl7 DFF74lM1RNpxMwMc1Fr4EWf/l2x8vv3WZKri5S7+HHuBsnTPYDMJIoyeAAGmG5VT/3VP Hqe1i9E14myhP7+Wg8eg+7W13WhuAUM9FPlhkMy5AjPLjmijquMO/8QHwGU3v5/+hAEs jjvuoKMPr/q2XOlzt11OH2zI2E/HqTrsJxkNwkmMTyuKrs5GDpf2bZaVFqzvOTnKkuQA kQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 38tsq0gyy5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 May 2021 10:05:22 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7C3C2100034; Fri, 28 May 2021 10:05:21 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 499C021B521; Fri, 28 May 2021 10:05:21 +0200 (CEST) Received: from localhost (10.75.127.48) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 May 2021 10:05:20 +0200 From: Yannick Fertre To: Yannick Fertre , Philippe Cornu , Antonio Borneo , "David Airlie" , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode() Date: Fri, 28 May 2021 10:05:13 +0200 Message-ID: <20210528080513.8168-1-yannick.fertre@foss.st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-28_04:2021-05-27,2021-05-28 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is not much value in the extra conversion step, the calculations required for the LTDC IP are different than what is used in the drm_display_mode_to_videomode(), so just do the right ones in the LTDC driver right away. Signed-off-by: Marek Vasut Signed-off-by: Yannick Fertre --- drivers/gpu/drm/stm/ltdc.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index e99771b947b6..d113b9be12c0 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -570,31 +570,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc) } } - drm_display_mode_to_videomode(mode, &vm); - DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name); - DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive); + DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay); DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n", - vm.hfront_porch, vm.hback_porch, vm.hsync_len, - vm.vfront_porch, vm.vback_porch, vm.vsync_len); + mode->hsync_start - mode->hdisplay, + mode->htotal - mode->hsync_end, + mode->hsync_end - mode->hsync_start, + mode->vsync_start - mode->vdisplay, + mode->vtotal - mode->vsync_end, + mode->vsync_end - mode->vsync_start); /* Convert video timings to ltdc timings */ - hsync = vm.hsync_len - 1; - vsync = vm.vsync_len - 1; - accum_hbp = hsync + vm.hback_porch; - accum_vbp = vsync + vm.vback_porch; - accum_act_w = accum_hbp + vm.hactive; - accum_act_h = accum_vbp + vm.vactive; - total_width = accum_act_w + vm.hfront_porch; - total_height = accum_act_h + vm.vfront_porch; + hsync = mode->hsync_end - mode->hsync_start - 1; + vsync = mode->vsync_end - mode->vsync_start - 1; + accum_hbp = mode->htotal - mode->hsync_start - 1; + accum_vbp = mode->vtotal - mode->vsync_start - 1; + accum_act_w = accum_hbp + mode->hdisplay; + accum_act_h = accum_vbp + mode->vdisplay; + total_width = mode->htotal - 1; + total_height = mode->vtotal - 1; /* Configures the HS, VS, DE and PC polarities. Default Active Low */ val = 0; - if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH) + if (mode->flags & DRM_MODE_FLAG_PHSYNC) val |= GCR_HSPOL; - if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH) + if (mode->flags & DRM_MODE_FLAG_PVSYNC) val |= GCR_VSPOL; if (bus_flags & DRM_BUS_FLAG_DE_LOW) -- 2.17.1