From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Ravnborg Date: Sat, 14 Jul 2018 20:56:15 +0000 Subject: [PATCH 1/1] atmel_lcdfb: support native-mode display-timings Message-Id: <20180714205615.GA21579@ravnborg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: dri-devel@lists.freedesktop.org, Nicolas Ferre Cc: Bartlomiej Zolnierkiewicz , Alexandre Belloni , linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org >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