From patchwork Fri Mar 17 20:59:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 9631617 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 54C0C60245 for ; Fri, 17 Mar 2017 21:05:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47BEA2860C for ; Fri, 17 Mar 2017 21:05:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B6A32861A; Fri, 17 Mar 2017 21:05:58 +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=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70E8C2860C for ; Fri, 17 Mar 2017 21:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751196AbdCQVF5 (ORCPT ); Fri, 17 Mar 2017 17:05:57 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:36152 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbdCQVF4 (ORCPT ); Fri, 17 Mar 2017 17:05:56 -0400 Received: by mail-lf0-f43.google.com with SMTP id y193so37797741lfd.3 for ; Fri, 17 Mar 2017 14:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=5M524XHN7UcOwLuDkYx59mN6lNBkmhYlP38xRDyx1T0=; b=WPITXFJ/XBA6bG53SPirvSSqDAgmA7PqPASyOUwe7su3EVAYfs46EHnicj4BgUtSTD zwkYxb2bTb+TAD58LSFUgTkgufeIzKH4rveI8cLGlbqHE85Fpav6FB+RVoNDjll3plBu 2vl1mxXIXxZm+l7ziM2rL616hdx00Q62XbdUBwZ3SDQBsJSsMvT8lBKPF6eCQw265Dr2 sdjR10uyXK5A5mnESWF2dFc/JBv5YYjkWkU9aWQwFITNBCTcfNUuurow03bW5W6dO/qE 3fJ8BZ3QEzyIzrfJbTEP3jm+IXR5Ovdb1GHt2xFkZqCzTqithqtKV+OZXBvwF/EzXWpn xb+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=5M524XHN7UcOwLuDkYx59mN6lNBkmhYlP38xRDyx1T0=; b=Z8gsOGX2aTjiobKL+5ss2CQAfcmvdXq91ZR2ziYZ2kTK2wA9YMshGfOtgsQMWEC58R EuLqM9Meqo1tnqSwCotTVnYBibG2Yf17aYzbWwu59XzvjTxdBmg1I+aVoGzqliCoRwgq WnqbyrxFqj7pl0/cX1pAxuFox/q/jIQWGzemucrwyxcz3rVL6OQvSIFEzB34NP98Y0D2 T59B5mkz7QReXbCxL6h5i6ZzPIs3B/FYe42UQ+6DBaZXSXFUPfm+9nuJaMceK1+PDx/u E7gAOHW77yfEpC203Pe5ZODm0PkxvRpuuM04MPHJMTkacUTiSvdQvgI+suBOn38zfwMC eFLQ== X-Gm-Message-State: AFeK/H0h7Wynrs6GlulFehM/53dXjLFUtjffta7ScBB98wbKsa7l5RAOEH3IXI81zB/kdg== X-Received: by 10.25.72.145 with SMTP id v139mr4974406lfa.74.1489784359974; Fri, 17 Mar 2017 13:59:19 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.81.191]) by smtp.gmail.com with ESMTPSA id h9sm1666352ljb.51.2017.03.17.13.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 13:59:19 -0700 (PDT) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Fri, 17 Mar 2017 23:59:15 +0300 Message-Id: <20170317205915.388401869@cogentembedded.com> User-Agent: quilt/0.64 Date: Fri, 17 Mar 2017 23:59:00 +0300 To: Rob Herring , Mark Rutland , Mauro Carvalho Chehab , devicetree@vger.kernel.org, linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Sergei Shtylyov Subject: [PATCH] media: platform: rcar_imr: add IMR-LX3 support MIME-Version: 1.0 Content-Disposition: inline; filename=media-platform-rcar_imr-add-IMR-LX3-support.patch Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for the image renderer light extended 3 (IMR-LX3) found only in the R-Car V2H (R8A7792) SoC. It's mostly the same as IMR-LSX3 but doesn't support video capture data as a source of 2D textures. Signed-off-by: Sergei Shtylyov --- This patch is against the 'media_tree.git' repo's 'master' branch plus the latest version of the Renesas IMR driver and the patch adding IMR-LSX3 support. Documentation/devicetree/bindings/media/rcar_imr.txt | 4 ++ drivers/media/platform/rcar_imr.c | 27 ++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) Index: media_tree/Documentation/devicetree/bindings/media/rcar_imr.txt =================================================================== --- media_tree.orig/Documentation/devicetree/bindings/media/rcar_imr.txt +++ media_tree/Documentation/devicetree/bindings/media/rcar_imr.txt @@ -9,6 +9,10 @@ and drawing with respect to any shape th Required properties: - compatible: + "renesas,-imr-lx3", "renesas,imr-lx3" as a fallback for the image + renderer light extended 3 (IMR-LX3) found in the R-Car gen2 SoCs, where the + examples with are: + - "renesas,r8a7792-imr-lx3" for R-Car V2H; "renesas,-imr-lsx3", "renesas,imr-lsx3" as a fallback for the image renderer light SRAM extended 3 (IMR-LSX3) found in the R-Car gen2 SoCs, where the examples with are: Index: media_tree/drivers/media/platform/rcar_imr.c =================================================================== --- media_tree.orig/drivers/media/platform/rcar_imr.c +++ media_tree/drivers/media/platform/rcar_imr.c @@ -1,5 +1,5 @@ /* - * rcar_imr.c -- R-Car IMR-LSX3/LX4 Driver + * rcar_imr.c -- R-Car IMR-LX3/LSX3/LX4 Driver * * Copyright (C) 2015-2017 Cogent Embedded, Inc. * @@ -82,6 +82,7 @@ struct imr_format_info { }; enum imr_type { + IMR_LX3, IMR_LSX3, IMR_LX4, }; @@ -153,7 +154,7 @@ struct imr_ctx { #define IMR_SSAR 0x38 #define IMR_DSTR 0x3C #define IMR_SSTR 0x40 -#define IMR_DSOR 0x50 +#define IMR_DSOR 0x50 /* IMR-LSX3/LX4 only */ #define IMR_CMRCR 0x54 #define IMR_CMRCSR 0x58 #define IMR_CMRCCR 0x5C @@ -200,7 +201,7 @@ struct imr_ctx { #define IMR_CMRCR_DUV GENMASK(4, 3) #define IMR_CMRCR_SUV_SHIFT 5 #define IMR_CMRCR_SUV GENMASK(6, 5) -#define IMR_CMRCR_YISM BIT(7) +#define IMR_CMRCR_YISM BIT(7) /* IMR-LSX3/LX4 only */ #define IMR_CMRCR_Y10 BIT(8) #define IMR_CMRCR_Y12 BIT(9) #define IMR_CMRCR_SY10 BIT(11) @@ -214,7 +215,7 @@ struct imr_ctx { #define IMR_TRIMR_AUTOSG BIT(3) #define IMR_TRIMR_TCM BIT(6) -#define IMR_TRICR_YCFORM BIT(31) +#define IMR_TRICR_YCFORM BIT(31) /* IMR-LSX3/LX4 only */ #define IMR_UVDPOR_UVDPO_SHIFT 0 #define IMR_UVDPOR_UVDPO GENMASK(2, 0) @@ -296,7 +297,7 @@ static u32 __imr_flags_common(u32 iflags return iflags & oflags & IMR_F_PLANES_MASK; } -static const struct imr_format_info imr_lsx3_formats[] = { +static const struct imr_format_info imr_lx3_formats[] = { { .name = "YUV 4:2:2 semiplanar (NV16)", .fourcc = V4L2_PIX_FMT_NV16, @@ -377,10 +378,16 @@ static const struct imr_format_info imr_ }, }; +static const struct imr_info imr_lx3 = { + .type = IMR_LX3, + .formats = imr_lx3_formats, + .num_formats = ARRAY_SIZE(imr_lx3_formats), +}; + static const struct imr_info imr_lsx3 = { .type = IMR_LSX3, - .formats = imr_lsx3_formats, - .num_formats = ARRAY_SIZE(imr_lsx3_formats), + .formats = imr_lx3_formats, + .num_formats = ARRAY_SIZE(imr_lx3_formats), }; static const struct imr_info imr_lx4 = { @@ -835,7 +842,8 @@ static void imr_dl_program_setup(struct *dl++ = IMR_OP_WTS(IMR_CPDPOR, __imr_cpdp(type)); /* reset rendering mode registers */ - *dl++ = IMR_OP_WTS(IMR_CMRCCR, 0xDBFE); + *dl++ = IMR_OP_WTS(IMR_CMRCCR, ctx->imr->info->type >= IMR_LSX3 ? + 0xDBFE : 0xDB7E); *dl++ = IMR_OP_WTS(IMR_CMRCCR2, ctx->imr->info->type == IMR_LX4 ? 0x9065 : IMR_CMRCR2_LUTE); @@ -1990,6 +1998,7 @@ static const struct dev_pm_ops imr_pm_op /* device table */ static const struct of_device_id imr_of_match[] = { + { .compatible = "renesas,imr-lx3", .data = &imr_lx3, }, { .compatible = "renesas,imr-lsx3", .data = &imr_lsx3, }, { .compatible = "renesas,imr-lx4", .data = &imr_lx4, }, { }, @@ -2011,5 +2020,5 @@ module_platform_driver(imr_platform_driv MODULE_ALIAS("imr"); MODULE_AUTHOR("Cogent Embedded Inc. "); -MODULE_DESCRIPTION("Renesas IMR-LSX3/LX4 Driver"); +MODULE_DESCRIPTION("Renesas IMR-LX3/LSX3/LX4 Driver"); MODULE_LICENSE("GPL");