From patchwork Sat Jul 14 20:56:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 10524871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C330E60626 for ; Sat, 14 Jul 2018 21:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A062128894 for ; Sat, 14 Jul 2018 21:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9401C28895; Sat, 14 Jul 2018 21:53:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D6A128895 for ; Sat, 14 Jul 2018 21:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RDCVbC+Szya0K92lORPf3BgofRA5hdQAFzecMGCUR48=; b=SS6sPUOOhs4b5K rtPrWo9HSs+TeaGIwG6wpUq12dPR2Pxr+Mz8lqv7vJZgdFvLv8y08hMPOwmbjsWjXDnM34MoqN2CY 6j8TmaASrMqmLz8UPd74FPEX+WpIvGwblMgYgDFwKXJHhmfOAdh8YEsKk2bpP/U06/KzsHY+/H+RR B5eudbAdSNO9tFjfcWNBC+oeBMsRJtRV15Hx/cDVbDTA1K6efCXdMiPH5DLN7b4HYpZYPDo1N74im uzx0VvcfP9zFMdrm66BTh6lrDFypDKj6auVf9LHmI/LdzknbzAoqN/zOT1fyzsqZSslLfmS0DdAwg xobRIzZ5zjbTWDMNCk5A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1feSTj-0003iT-LZ; Sat, 14 Jul 2018 21:53:23 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feSTW-0003VM-7a for linux-arm-kernel@bombadil.infradead.org; Sat, 14 Jul 2018 21:53:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FBn8094YpB75k2KFJ3qCwo6E9Yty2auTX1SYJ5M42Do=; b=t/X0yeDsCGhZUCi9yFvcGto4jz aaL8TPmn2gdCshuxFIXzYswhJaCBuB4PMtXPOvGTkLSsZxrYUEDwqM/sNBICvQDjwm6YGPm+0nq07 +m7FC9W8+oY1uFcOHWPauazp5NM7aQnca/V7JqA6iPEYskh6LKOTBAVFfrvF56RBVXX/uV15Tipr6 Is6x3ubNbyTTc5uSKcwzPhu/fGyVJPY0/K0AI2UyDeGuXuib5afbEcAOjS6IKbjTXiY07uIl4ygu5 FV4RpRv+5UMP4M8KLuGX94SQnzPqzzCDYQG1YTQY7yGfr0p25XpOGr4PG45/SycynGHppX1xLTZzD Clzfs7XA==; Received: from asavdk3.altibox.net ([109.247.116.14]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feRap-0001FH-Sw for linux-arm-kernel@lists.infradead.org; Sat, 14 Jul 2018 20:56:41 +0000 Received: from ravnborg.org (unknown [158.248.196.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 41A8E20036; Sat, 14 Jul 2018 22:56:17 +0200 (CEST) Date: Sat, 14 Jul 2018 22:56:15 +0200 From: Sam Ravnborg To: dri-devel@lists.freedesktop.org, Nicolas Ferre Subject: [PATCH 1/1] atmel_lcdfb: support native-mode display-timings Message-ID: <20180714205615.GA21579@ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=dqr19Wo4 c=1 sm=1 tr=0 a=ddpE2eP9Sid01c7MzoqXPA==:117 a=ddpE2eP9Sid01c7MzoqXPA==:17 a=kj9zAlcOel0A:10 a=7gkXJVJtAAAA:8 a=XYAwZIGsAAAA:8 a=hD80L64hAAAA:8 a=P-IC7800AAAA:8 a=5hwdKRlHIUP8x7IPmiYA:9 a=CjuIK1q_8ugA:10 a=E9Po1WZjFZOl8hwRPBS3:22 a=E8ToXWR_bxluHZ7gmE-Z:22 a=d3PnA9EDa4IxuAV0gXij:22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180714_165640_200657_C6A1C38F X-CRM114-Status: GOOD ( 22.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Alexandre Belloni , linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartlomiej Zolnierkiewicz Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From 8aded81852666b591624001ec02aa4dc0d8f4cfb Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 14 Jul 2018 22:17:18 +0200 Subject: [PATCH 1/1] atmel_lcdfb: support native-mode display-timings When a device tree set a display-timing using native-mode then according to the bindings doc this should: native-mode: The native mode for the display, in case multiple modes are provided. When omitted, assume the first node is the native. The atmel_lcdfb used the last timing subnode and did not respect the timing mode specified with native-mode. Introduce use of of_get_videomode() which allowed a nice simplification of the code while also added support for native-mode. As a nice side-effect this fixes a memory leak where the data used for timings and the display_np was not freed. Signed-off-by: Sam Ravnborg Cc: Nicolas Ferre Cc: Bartlomiej Zolnierkiewicz Cc: Alexandre Belloni --- Tested on a proprietary board utilizing an at91sam9263. Problem was found because I uses the bootloader to set the native-mode depending on the mounted display. Please note - I may have missed some magic around selecting the correct videomode. The patch was to some extend based on what was done in the mxsfb driver. I am away a few days after sunday, but decided to send out the patch in order to collect potential review feedback. Sam drivers/video/fbdev/atmel_lcdfb.c | 43 ++++++++------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 076d24afbd72..4ed55e6bbb84 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -22,6 +22,7 @@ #include #include #include +#include