[{"id":1767813,"web_url":"http://patchwork.ozlabs.org/comment/1767813/","msgid":"<20170913115110.ptzxoe2gqvq4joqp@flea.lan>","list_archive_url":null,"date":"2017-09-13T11:51:10","subject":"Re: [U-Boot] [PATCH v3 1/3] video: sunxi: extract simplefb match\n\tcode to a new file","submitter":{"id":12916,"url":"http://patchwork.ozlabs.org/api/people/12916/","name":"Maxime Ripard","email":"maxime.ripard@free-electrons.com"},"content":"On Wed, Sep 13, 2017 at 10:17:49AM +0800, Icenowy Zheng wrote:\n> As the DE2 simplefb setup code can also benefit from the simplefb match\n> code, extract it to a new source file.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> Reviewed-by: Andre Przywara <andre.przywara@arm.com>\n\nAcked-by: Maxime Ripard <maxime.ripard@free-electrons.com>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsg8Q0PsXz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 21:55:17 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 806F2C2205B; Wed, 13 Sep 2017 11:55:11 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 6DA9DC2256E;\n\tWed, 13 Sep 2017 11:52:07 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 64CB7C2254B; Wed, 13 Sep 2017 11:52:06 +0000 (UTC)","from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54])\n\tby lists.denx.de (Postfix) with ESMTP id 0618FC220AA\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 11:51:11 +0000 (UTC)","by mail.free-electrons.com (Postfix, from userid 110)\n\tid BFAD720998; Wed, 13 Sep 2017 13:51:10 +0200 (CEST)","from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr\n\t[90.63.216.87])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 937A920946;\n\tWed, 13 Sep 2017 13:51:10 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","Date":"Wed, 13 Sep 2017 13:51:10 +0200","From":"Maxime Ripard <maxime.ripard@free-electrons.com>","To":"Icenowy Zheng <icenowy@aosc.io>","Message-ID":"<20170913115110.ptzxoe2gqvq4joqp@flea.lan>","References":"<20170913021751.9289-1-icenowy@aosc.io>\n\t<20170913021751.9289-2-icenowy@aosc.io>","MIME-Version":"1.0","In-Reply-To":"<20170913021751.9289-2-icenowy@aosc.io>","User-Agent":"NeoMutt/20170714 (1.8.3)","Cc":"u-boot@lists.denx.de, linux-sunxi@googlegroups.com,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH v3 1/3] video: sunxi: extract simplefb match\n\tcode to a new file","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============5710671382728682702==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1767904,"web_url":"http://patchwork.ozlabs.org/comment/1767904/","msgid":"<20170913164655.6afa5eb5@i7>","list_archive_url":null,"date":"2017-09-13T13:46:55","subject":"Re: [U-Boot] [linux-sunxi] [PATCH v3 1/3] video: sunxi: extract\n\tsimplefb match code to a new file","submitter":{"id":5874,"url":"http://patchwork.ozlabs.org/api/people/5874/","name":"Siarhei Siamashka","email":"siarhei.siamashka@gmail.com"},"content":"On Wed, 13 Sep 2017 10:17:49 +0800\nIcenowy Zheng <icenowy@aosc.io> wrote:\n\n> As the DE2 simplefb setup code can also benefit from the simplefb match\n> code, extract it to a new source file.\n> \n> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>\n> Reviewed-by: Andre Przywara <andre.przywara@arm.com>\n> ---\n> Changes in v3:\n> - Use /** to start kerndoc.\n> \n>  drivers/video/sunxi/Makefile          |  2 +-\n>  drivers/video/sunxi/simplefb_common.c | 29 +++++++++++++++++++++++++++++\n>  drivers/video/sunxi/simplefb_common.h | 22 ++++++++++++++++++++++\n>  drivers/video/sunxi/sunxi_display.c   | 13 ++-----------\n>  4 files changed, 54 insertions(+), 12 deletions(-)\n>  create mode 100644 drivers/video/sunxi/simplefb_common.c\n>  create mode 100644 drivers/video/sunxi/simplefb_common.h\n> \n> diff --git a/drivers/video/sunxi/Makefile b/drivers/video/sunxi/Makefile\n> index 0d64c2021f..10862edaca 100644\n> --- a/drivers/video/sunxi/Makefile\n> +++ b/drivers/video/sunxi/Makefile\n> @@ -5,5 +5,5 @@\n>  # SPDX-License-Identifier:\tGPL-2.0+\n>  #\n>  \n> -obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o lcdc.o tve_common.o ../videomodes.o\n> +obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o simplefb_common.o lcdc.o tve_common.o ../videomodes.o\n>  obj-$(CONFIG_VIDEO_DE2) += sunxi_de2.o sunxi_dw_hdmi.o lcdc.o ../dw_hdmi.o\n> diff --git a/drivers/video/sunxi/simplefb_common.c b/drivers/video/sunxi/simplefb_common.c\n> new file mode 100644\n> index 0000000000..4823f13a0c\n> --- /dev/null\n> +++ b/drivers/video/sunxi/simplefb_common.c\n> @@ -0,0 +1,29 @@\n> +/*\n> + * Common code for Allwinner SimpleFB with pipeline.\n> + *\n> + * (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>\n\nYour copyright notice seems to be missing\n\n * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>\n\n> + * (C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>\n> + *\n> + * SPDX-License-Identifier:\tGPL-2.0+\n> + */\n> +\n> +#include <fdtdec.h>\n> +\n> +int sunxi_simplefb_fdt_match(void *blob, const char *pipeline)\n> +{\n> +\tint offset, ret;\n> +\n> +\t/* Find a prefilled simpefb node, matching out pipeline config */\n> +\toffset = fdt_node_offset_by_compatible(blob, -1,\n> +\t\t\t\t\t       \"allwinner,simple-framebuffer\");\n> +\twhile (offset >= 0) {\n> +\t\tret = fdt_stringlist_search(blob, offset, \"allwinner,pipeline\",\n> +\t\t\t\t\t    pipeline);\n> +\t\tif (ret == 0)\n> +\t\t\tbreak;\n> +\t\toffset = fdt_node_offset_by_compatible(blob, offset,\n> +\t\t\t\t\t       \"allwinner,simple-framebuffer\");\n> +\t}\n> +\n> +\treturn offset;\n> +}\n> diff --git a/drivers/video/sunxi/simplefb_common.h b/drivers/video/sunxi/simplefb_common.h\n> new file mode 100644\n> index 0000000000..1a2bfabf00\n> --- /dev/null\n> +++ b/drivers/video/sunxi/simplefb_common.h\n> @@ -0,0 +1,22 @@\n> +/*\n> + * (C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>\n> + *\n> + * SPDX-License-Identifier:\tGPL-2.0+\n> + */\n> +\n> +#ifndef __SIMPLEFB_COMMON_H\n> +#define __SIMPLEFB_COMMON_H\n> +\n> +/**\n> + * sunxi_simplefb_fdt_match() - match a sunxi simplefb node\n> + *\n> + * Match a sunxi simplefb device node with a specified pipeline, and\n> + * return its offset.\n> + *\n> + * @blob: device tree blob\n> + * @pipeline: display pipeline\n> + * @return device node offset in blob, or negative values if failed\n> + */\n> +int sunxi_simplefb_fdt_match(void *blob, const char *pipeline);\n> +\n> +#endif\n> diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c\n> index de768ba94a..7f25ed5f26 100644\n> --- a/drivers/video/sunxi/sunxi_display.c\n> +++ b/drivers/video/sunxi/sunxi_display.c\n> @@ -29,6 +29,7 @@\n>  #include \"../anx9804.h\"\n>  #include \"../hitachi_tx18d42vm_lcd.h\"\n>  #include \"../ssd2828.h\"\n> +#include \"simplefb_common.h\"\n>  \n>  #ifdef CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW\n>  #define PWM_ON 0\n> @@ -1377,17 +1378,7 @@ int sunxi_simplefb_setup(void *blob)\n>  \t\tbreak;\n>  \t}\n>  \n> -\t/* Find a prefilled simpefb node, matching out pipeline config */\n> -\toffset = fdt_node_offset_by_compatible(blob, -1,\n> -\t\t\t\t\t       \"allwinner,simple-framebuffer\");\n> -\twhile (offset >= 0) {\n> -\t\tret = fdt_stringlist_search(blob, offset, \"allwinner,pipeline\",\n> -\t\t\t\t\t    pipeline);\n> -\t\tif (ret == 0)\n> -\t\t\tbreak;\n> -\t\toffset = fdt_node_offset_by_compatible(blob, offset,\n> -\t\t\t\t\t       \"allwinner,simple-framebuffer\");\n> -\t}\n> +\toffset = sunxi_simplefb_fdt_match(blob, pipeline);\n>  \tif (offset < 0) {\n>  \t\teprintf(\"Cannot setup simplefb: node not found\\n\");\n>  \t\treturn 0; /* Keep older kernels working */\n\nHere is the \"git blame\" output for this part of code that you are\nmoving around by your patch:\n\n2dae800f drivers/video/sunxi_display.c       (Hans de Goede     2014-12-21 16:28:32 +0100 1380) \t/* Find a prefilled simpefb node, matching out pipeline config */\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1381) \toffset = fdt_node_offset_by_compatible(blob, -1,\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1382) \t\t\t\t\t       \"allwinner,simple-framebuffer\");\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1383) \twhile (offset >= 0) {\nb02e4044 drivers/video/sunxi_display.c       (Simon Glass       2016-10-02 17:59:28 -0600 1384) \t\tret = fdt_stringlist_search(blob, offset, \"allwinner,pipeline\",\n6e67f176 drivers/video/sunxi_display.c       (Masahiro Yamada   2016-10-17 20:43:01 +0900 1385) \t\t\t\t\t    pipeline);\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1386) \t\tif (ret == 0)\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1387) \t\t\tbreak;\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1388) \t\toffset = fdt_node_offset_by_compatible(blob, offset,\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1389) \t\t\t\t\t       \"allwinner,simple-framebuffer\");\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1390) \t}\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1391) \tif (offset < 0) {\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1392) \t\teprintf(\"Cannot setup simplefb: node not found\\n\");\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1393) \t\treturn 0; /* Keep older kernels working */\n2d7a084b drivers/video/sunxi_display.c       (Luc Verhaegen     2014-08-13 07:55:07 +0200 1394) \t}\n\nLuc Verhaegen is the real author of the sunxi DE1 simplefb code in\nU-Boot. If you need to pick only one copyright line from the old code,\nthen you should mention Luc instead of Hans. Hans de Goede surely\nhas done a lot of massaging for this code later (plus added EDID and\nLCD support). But it was Luc, who made it happen back in 2014 by\nproviding a usable graphics support for the mainline kernel users\nand laid down the foundation for all the further incremental\nimprovements.\n\nIf not for Luc Verhaegen, we don't even know what would be the current\nstate of the graphics support on sunxi hardware. And the number of\ncommits does not matter, what matters is having the job done. And Luc\ndid just that. So let's give credit where it is due.\n\nWith a proper copyright notice, this patch is\nAcked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"gxJT490f\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsjdZ43g3z9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 23:47:14 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 45E7FC21DDE; Wed, 13 Sep 2017 13:47:10 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 80E4BC21E1C;\n\tWed, 13 Sep 2017 13:47:06 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 678D3C21E1C; Wed, 13 Sep 2017 13:47:05 +0000 (UTC)","from mail-lf0-f67.google.com (mail-lf0-f67.google.com\n\t[209.85.215.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 023C0C21DDE\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 13:47:05 +0000 (UTC)","by mail-lf0-f67.google.com with SMTP id h80so148442lfe.1\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 06:47:04 -0700 (PDT)","from i7 (dsl-hkibng32-54fbf7-46.dhcp.inet.fi. [84.251.247.46])\n\tby smtp.gmail.com with ESMTPSA id\n\td8sm2533314lfd.3.2017.09.13.06.47.02\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Sep 2017 06:47:03 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=uB/7rAv2zI4Wd3FRwgdJSEijKFK4A6DyZcamkAf+FvQ=;\n\tb=gxJT490fcwnmpGoL9P6y8uoxcxv1J+F1Ho/mR4eMehdBj9lByJzgBUDlbBMJG6ragU\n\t2Lrsg6wnyzFErrpOITmR7W65ihFnSGm87lz9PWvJu7y1NDE8TRXQb1L5HUbFvotY6LuS\n\tD/X7BNSGJgEkPIByGZQbTa6FUR3ZT3Z6jcsnbDZLs2dAWp67hBNDRdYYhyA1ErzVAtiG\n\tvuuaswoXcjKS6izzuzNKcHs7aXSIN2Z5CRQhnuhGKovePoqOsU9tU92GxwUTQF4tJtI/\n\tsLSS6wx4rioCRLj2UQK4eQmIwyHKiOtOvvveCw2l2YFVjix91o5OpbFDwRoHHHwEoWeC\n\tlgZw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=uB/7rAv2zI4Wd3FRwgdJSEijKFK4A6DyZcamkAf+FvQ=;\n\tb=r+EWnkdsiwKiCTs1PQupOYsMtuo8IQ8bWJW+/bzXeRDbLRmKz9njOwkXMY8OpcjPZj\n\tv2PCHp5GiiyEPYaXAqtxPcTmSr+KAlRZVhXZXgFmoPe2b4apy8sUq87hawRnpXYplxGn\n\tkaagzZdoXD5W7l+41weSv23Wf94ZAs9jIZJAxz7ZnLmZxjemFS61iWALvYANFana8Fwu\n\tpezX+r8Y9KcbDvThvBgHaIF3Un5hxb3EuTaw5fkisd9T0KuhliA4DAPSFPcjhrPuO+Vl\n\tS9pE0cffy9x0PJiAgSCi/lqwaRTfoTr2vWp2g4J/IK7udR2zFgd3jZfeIlSiPcQUxxRa\n\t22fw==","X-Gm-Message-State":"AHPjjUho8ulGoNeidcb98w8MdsmHmmhm6hLmJQ/nODcO4ms6jTGEfC2q\n\tu3unltvv0LgpQw==","X-Google-Smtp-Source":"AOwi7QDNZCamuaXNGSkSWQZG2NzOrKkUe8Yc6zo8+sljY2IhSi/7dOecv40ol482AI7wPvh30ssQCw==","X-Received":"by 10.46.91.144 with SMTP id m16mr3173286lje.95.1505310424299;\n\tWed, 13 Sep 2017 06:47:04 -0700 (PDT)","Date":"Wed, 13 Sep 2017 16:46:55 +0300","From":"Siarhei Siamashka <siarhei.siamashka@gmail.com>","To":"Icenowy Zheng <icenowy@aosc.io>","Message-ID":"<20170913164655.6afa5eb5@i7>","In-Reply-To":"<20170913021751.9289-2-icenowy@aosc.io>","References":"<20170913021751.9289-1-icenowy@aosc.io>\n\t<20170913021751.9289-2-icenowy@aosc.io>","X-Mailer":"Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Cc":"u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>, \n\tJagan Teki <jagan@openedev.com>, linux-sunxi@googlegroups.com","Subject":"Re: [U-Boot] [linux-sunxi] [PATCH v3 1/3] video: sunxi: extract\n\tsimplefb match code to a new file","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]