Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp101649ybm; Mon, 20 May 2019 12:39:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYFvXsdJ1IZTVHRyaWTR7zjj+LkDAvOLlnawMa1GVo9r8Uw+32/26l9BCKSkvTrLwcGTYa X-Received: by 2002:a62:cdc6:: with SMTP id o189mr55770002pfg.74.1558381189446; Mon, 20 May 2019 12:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558381189; cv=none; d=google.com; s=arc-20160816; b=FZP362l43eLb2BK6oxjlGt10XFdYVmg0o3kDbs2FIXWKADNe+iqwfxD+K+/QNE5EQI t1K4hnGqehzAC5m2k4ZKl5H7cKPyADOnRqOARwHBh0chgA0sCcVhk9fjd/4qnTs8rYZD Ac4vfRoHoN0bwIX6WIhKvo1kPVGKXgXnXRvym+dRwqlULGv1hxeMD+eTskQruP3nllSX +S1wT1luR56dRbVrdCFt3fc+qeU2DZPrU9CTM5JhqQYcJz9zWr/+I9rZA8a88yP3WLWm GbWIgN8Lc+5B6rTMN6XiJc3qZow7VGHIyF01q46KIHWZwCQs/fjLYJ2Iu7TeQiaO7z/d 3GvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XVji6EW7+3Muo/zfup6MVTf/3d/utIq25qSjoZ1JLts=; b=RDyx5eBBLx8O3+FI/0bbHQqeePGcFLM4gWtTEzCHjSOEs7jNwQld02oC50sUZBKHV3 tSTqhLUtEKxBzjouqBhEI9X1quhMnVA1jZsDY8moUBg0mV0vXNzobGg2wC9047/foIWE YZXam0KxxvMJ50/dbFwAniGq4Uwhh6dI1klykqDSFG4QkzS15wBi9bBV1S0T1sYMlSaY r21rP01N7luYqGHeVnJZqW8xMzPcHvRnlCVx56XPppuRyQvYBM8QBI85NSGOgX4Qrvf1 tiL8lwpHh2X44YukRz3gAZSTVasauWkaY1kqOZdGh3w18p64ba/nyUJNon+SzheGj3sP cSZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=OjJQYTl5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si18811310plc.181.2019.05.20.12.39.34; Mon, 20 May 2019 12:39:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=OjJQYTl5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbfETThB (ORCPT + 99 others); Mon, 20 May 2019 15:37:01 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:34361 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfETThA (ORCPT ); Mon, 20 May 2019 15:37:00 -0400 Received: by mail-ot1-f66.google.com with SMTP id l17so14127662otq.1 for ; Mon, 20 May 2019 12:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XVji6EW7+3Muo/zfup6MVTf/3d/utIq25qSjoZ1JLts=; b=OjJQYTl5xqc9g9jBo9P61CScZaOFd89JYM+lXP+wWpwnM5V85ht/CH5QBwe3G6xum/ NQacpr0MMdVXwY77pd9fHReGdHexG8HnZY9OPu0ByLOaJkfRoOWt5rSZX0LQ3T5LEBwr JNO9ZzQCC4Ft8SIiXHjQIUjPl6wGB78mKQw9jXsyQp0kRZYTwbGU15l7UTVqVAQJePUR woyvknrDveua2kKithc9BI89DXCEoU2ghvohNcAT3ZUhr1qdIeU/ZRJlgEHpLoTtQ6Gt yTHm3Kc9d0Mhy/F8gIAjHwX5U8l7KCmlcTzq1mTQnwMgp9+gadfZ9EjixHDrVt5FWj4M ENSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XVji6EW7+3Muo/zfup6MVTf/3d/utIq25qSjoZ1JLts=; b=mcQOoPlVtpX73Yw/m0+KivtVjAoIJWp99mTeVSY4CpDXCVaBy3c18VgYCHpePGBefK 6M/mVlhW4hksrBOBtSAYMoe0y0LuM9dhcNPDDXnvvMgGw7unVl2VyzRTYOdM3N2cVFPE UPcAZ4eADja/SuJceQw35bvPna2oVZ5F/KWq7saHJ2SgGpl2C41CKUvJRaCb4/knEoeZ rU+qbMUYB85N/1/SCkhPS42ZdeDLEESv7Rx8HmZbjZ6cqVtz/q3vE05cF5+rMZUgWv0V Jy2S85iBOOps1xWmmlf3u/VZMp9g9IPMZl6loQqT0Y/+e0U6SkLDmAkEIoPzxv+cLEoa f3qw== X-Gm-Message-State: APjAAAXTmBoKoLWgBNBp9h5p1Rqg63Ik/wQUbR9dlz/fetzYnYAPegGL nDl2bMT+ML6Dl34I6atKM2SAuJlR0LSuoDsbbsCoj+QBj9g= X-Received: by 2002:a9d:69c8:: with SMTP id v8mr46812783oto.6.1558381020106; Mon, 20 May 2019 12:37:00 -0700 (PDT) MIME-Version: 1.0 References: <20190413171532.25967-1-martin.blumenstingl@googlemail.com> In-Reply-To: From: Martin Blumenstingl Date: Mon, 20 May 2019 21:36:49 +0200 Message-ID: Subject: Re: [PATCH 0/3] 32-bit Meson: add the canvas module To: Maxime Jourdan Cc: linux-amlogic , Kevin Hilman , mjourdan@baylibre.com, Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Mon, May 20, 2019 at 9:21 PM Maxime Jourdan wrote: > > Hey Martin, so sorry for forgetting about this. > > On Thu, Apr 18, 2019 at 9:50 PM Martin Blumenstingl > wrote: > > > > Hi Maxime, > > > > On Sat, Apr 13, 2019 at 8:54 PM Maxime Jourdan wrote: > > > > > > Hi Martin, > > > On Sat, Apr 13, 2019 at 7:15 PM Martin Blumenstingl > > > wrote: > > > > > > > > This adds the canvas module on Meson8, Meson8b and Meson8m2. The canvas > > > > IP is used by the video decoder hardware as well as the VPU (video > > > > output) hardware. > > > > > > > > Neither the VPU nor the video decoder driver support the 32-bit SoCs > > > > yet. However, we can still add the canvas module to have it available > > > > once these drivers gain support for the older SoCs. > > > > > > > > I have tested this on my Meson8m2 board by hacking the VPU driver to > > > > not re-initialize the VPU (and to use the configuration set by u-boot). > > > > With that hack I could get some image out of the CVBS connector. No > > > > changes to the canvas driver were required. > > > > > > > > Due to lack of hardware I could not test Meson8, but I'm following (as > > > > always) what the Amlogic 3.10 vendor kernel uses. > > > > Meson8b is also not tested because u-boot of my EC-100 doesn't have > > > > video output enabled (so I couldn't use the same hack I used on my > > > > Meson8m2 board). > > > > > > > > This series meant to be applied on top of "Meson8b: add support for the > > > > RTC on EC-100 and Odroid-C1" from [0] > > > > > > > > > > > > > > The series looks good to me, however I wonder if we should maybe add a > > > new compatible ? > > > > > > The canvas IP before the GX* generation does not handle what Amlogic > > > calls "endianness", the field that allows doing some byte-switching to > > > get proper NV12/NV21. So the following defines are unusable: > > > > > > #define MESON_CANVAS_ENDIAN_SWAP16 0x1 > > > #define MESON_CANVAS_ENDIAN_SWAP32 0x3 > > > #define MESON_CANVAS_ENDIAN_SWAP64 0x7 > > > #define MESON_CANVAS_ENDIAN_SWAP128 0xf > > I didn't know about this - thank you for pointing this out. > > > > your suggestions to add new compatible strings is a good idea for that case. > > Amlogic uses different defines for Meson8 and Meson8m2 in their vendor > > kernel and they keep Meson8b different. > > I will add three new compatibles, one for each SoC (Meson8, Meson8b, > > Meson8m2) just to be on the safe side if we discover differences in > > the canvas IP on these SoCs. > > > > what do you think? > > > > Sure thing. Keep an eye out for any hints regarding the amount of > canvases as well, I *think* I remember some old SoCs having only 192 > but I haven't been able to find it again. Meson6 and older are limited to 192, Meson8 and newer already support 256. source: [0] > > > It wouldn't change much functionally, but we could have e.g a warning > > > if a m8 canvas user tries to set endianness even though it does > > > nothing. > > this is a good idea, that will make it easier to spot why something > > doesn't work. > > we can also return -EINVAL, like you already do for the case where the > > canvas ID is already used. > > > > Yes, returning an error is a good idea. OK, I'll send an updated series later. Martin [0] https://github.com/endlessm/linux-meson/blob/5cb4882cdda584878a29132aeb9a90497a121df9/drivers/amlogic/canvas/canvas.c#L41