[linux-sunxi] [PATCH v2 3/3] dt-bindings: arm: sunxi: document orig PineTab DT as sample

2020-12-23 Thread Icenowy Zheng
As the original PineTab DT (which uses sun50i-a64-pinetab name) is only
for development samples, document this.

Signed-off-by: Icenowy Zheng 
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 2 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml 
b/Documentation/devicetree/bindings/arm/sunxi.yaml
index 8c62a1e2a498..7eec85be7ab9 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -695,7 +695,7 @@ properties:
   - const: pine64,pinephone-1.2
   - const: allwinner,sun50i-a64
 
-  - description: Pine64 PineTab
+  - description: Pine64 PineTab, Development Sample
 items:
   - const: pine64,pinetab
   - const: allwinner,sun50i-a64
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index 0494bfaf2ffa..422a8507f674 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -14,7 +14,7 @@
 #include 
 
 / {
-   model = "PineTab";
+   model = "PineTab, Development Sample";
compatible = "pine64,pinetab", "allwinner,sun50i-a64";
 
aliases {
-- 
2.28.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201224024138.19422-1-icenowy%40aosc.io.


[linux-sunxi] [PATCH v2 2/3] arm64: allwinner: dts: a64: add DT for Early Adopter's PineTab

2020-12-23 Thread Icenowy Zheng
PineTabs since Early Adopter batch will use a new LCD panel.

Add device tree for PineTab with the new panel.

Signed-off-by: Icenowy Zheng 
---
 arch/arm64/boot/dts/allwinner/Makefile|  1 +
 .../sun50i-a64-pinetab-early-adopter.dts  | 26 +++
 2 files changed, 27 insertions(+)
 create mode 100644 
arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab-early-adopter.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile 
b/arch/arm64/boot/dts/allwinner/Makefile
index 211d1e9d4701..41ce680e5f8d 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a100-allwinner-perf1.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab-early-adopter.dts 
b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab-early-adopter.dts
new file mode 100644
index ..652fc0cce304
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab-early-adopter.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2020 Icenowy Zheng 
+ *
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64-pinetab.dts"
+
+/ {
+   model = "PineTab, Early Adopter's version";
+   compatible = "pine64,pinetab-early-adopter", "allwinner,sun50i-a64";
+};
+
+ {
+   /delete-node/ panel@0;
+
+   panel@0 {
+   compatible = "feixin,k101-im2byl02";
+   reg = <0>;
+   power-supply = <_dc1sw>;
+   reset-gpios = < 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
+   backlight = <>;
+   };
+};
-- 
2.28.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201224024001.19248-2-icenowy%40aosc.io.


[linux-sunxi] [PATCH v2 1/3] dt-bindings: arm: sunxi: add PineTab Early Adopter edition

2020-12-23 Thread Icenowy Zheng
Early adopter's PineTabs (and further releases) will have a new LCD
panel different with the one that is used when in development (because
the old panel's supply discontinued).

Add a new DT compatible for it.

Signed-off-by: Icenowy Zheng 
---
 Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml 
b/Documentation/devicetree/bindings/arm/sunxi.yaml
index 6db32fbf813f..8c62a1e2a498 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -700,6 +700,11 @@ properties:
   - const: pine64,pinetab
   - const: allwinner,sun50i-a64
 
+  - description: Pine64 PineTab, Early Adopter's batch (and maybe later 
ones)
+items:
+  - const: pine64,pinetab-early-adopter
+  - const: allwinner,sun50i-a64
+
   - description: Pine64 SoPine Baseboard
 items:
   - const: pine64,sopine-baseboard
-- 
2.28.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201224024001.19248-1-icenowy%40aosc.io.


Re: [linux-sunxi] Allwinner A13 (Olimex A13SOM) DRM support

2020-12-23 Thread Clément Péron
Hi Sergio,

On Wed, 23 Dec 2020 at 17:24, Sergio Sota  wrote:
>
> Hi Clement,
>
> you mean the sun5i.dtsi device tree patch? we added the mali gpu support and
> also change the frontend compatible to "allwinner,sun4i-a10-display-frontend"
> We are not experts but if you are confident enough sure we can send a patch to
> linux ML :-) but the rest of things (custom lcd panel, custom board, etc.) is
> specific to our custom system. Besides there is something wrong, we still have
> problems with OpenGL apps, that crush without reason with a Segmentation Fault
> (we think is something mesa3d/x11 related, as modetest and kmscube works but
> you never know...)

Yes one patch for the Mali node and one patch to have
"allwinner,sun4i-a10-display-frontend" as fallback.

 fe0: display-frontend@1e0 {
compatible = "allwinner,sun5i-a13-display-frontend",
"allwinner,sun4i-a10-display-frontend";

The assigned clock-rate is a bit high, you could try with 32000
which is the vendor clock.

Regards,
Clement

>
> Best Regards,
> Sergio Sota
>
> Here is the suggested linux ML patch file "sun5i-gpu-frontend-support.patch"
> =
> diff -Naur linux-old/arch/arm/boot/dts/sun5i.dtsi 
> linux-new/arch/arm/boot/dts/sun5i.dtsi
> --- linux-old/arch/arm/boot/dts/sun5i.dtsi2020-11-24 13:39:15.0 
> +0100
> +++ linux-new/arch/arm/boot/dts/sun5i.dtsi2020-12-23 10:12:57.950313393 
> +0100
> @@ -726,6 +726,18 @@
>  #size-cells = <0>;
>  };
>
> +mali: gpu@1c4 {
> +compatible = "allwinner,sun4i-a10-mali", "arm,mali-400";
> +reg = <0x01c4 0x1>;
> +interrupts = <69>, <70>, <71>, <72>,  <73>;
> +interrupt-names = "gp", "gpmmu", "pp0", "ppmmu0", "pmu";
> +clocks = < CLK_AHB_GPU>, < CLK_GPU>;
> +clock-names = "bus", "core";
> +resets = < RST_GPU>;
> +assigned-clocks = < CLK_GPU>;
> +assigned-clock-rates = <38400>;
> +};
> +
>  timer@1c6 {
>  compatible = "allwinner,sun5i-a13-hstimer";
>  reg = <0x01c6 0x1000>;
> @@ -734,7 +746,7 @@
>  };
>
>  fe0: display-frontend@1e0 {
> -compatible = "allwinner,sun5i-a13-display-frontend";
> +compatible = "allwinner,sun4i-a10-display-frontend";
>  reg = <0x01e0 0x2>;
>  interrupts = <47>;
>  clocks = < CLK_DE_FE>, < CLK_DE_FE>,
> =
>
> El martes, 22 de diciembre de 2020 a las 23:03:02 UTC+1, peron...@gmail.com 
> escribió:
>>
>> Hi Sergio,
>>
>>
>> Le mar. 22 déc. 2020 à 17:50, Sergio Sota  a écrit :
>>>
>>> Hi Clement, Chen-Yu Tsai and Jernej Škrabec,
>>>
>>> the last question was of topic (as the A13SOM drm driver support was solved)
>>
>>
>> As the DRM issue is solved by using some patches could you send those 
>> patches to linux ML ?
>>
>> Thanks Clément
>>
>>> but just to complete here are our findings and solution to this issue.
>>>
>>> we finally found the problem: x11-server was compiled without glamor driver.
>>> Before we enabled glamor we have only software rendering on x11, but 
>>> checking
>>> mesa3d documentation: to use OpenGL with Lima driver and x11 there is needed
>>> modesetting & glamor drivers (the last one where missed by a libepoxy 
>>> library
>>> dependency) Then the message "libEGL warning: DRI2: failed to authenticate" 
>>> no
>>> longer appears... but now all OpenGL apps crash (with a "Segmentation 
>>> fault")
>>> We checked the /tmp/Xorg.0.log file and found only one error message:
>>>
>>> ...
>>> (EE) AIGLX error: sun4i-drm does not export required DRI extension
>>> (II) IGLX: Loaded and initialized swrast
>>> ...
>>>
>>> The solution was found thanks to the following post, short story: the 
>>> xserver
>>> doesn't recognize drivers with hyphen in the name (sun4i-drm), we use xorg
>>> version 1.20.9 and have found there is needed a patch (located in the post)
>>>
>>> "https://forum.clockworkpi.com/t/apt-full-upgrade-getting-the-new-software-updates-from-debian/5664;
>>>
>>> Once we aplied the patch there are no more error messages on Xorg.0.log
>>>
>>> ...
>>> (II) AIGLX: Loaded and initialized sun4i-drm
>>> (II) GLX: Initialized DRI2 GL provider for screen 0
>>> ...
>>>
>>> All seems to be fine, but OpenGL apps still crash. If we use kmscube test
>>> (after killing xorg server to permit the access) the app works fine (60fps)
>>>
>>> We have reported this issue to the mesa3d-users mail list and will keep on
>>> searching for a solution. Any help or clue would be greatly appreciated.
>>> Thanks for your help and time!
>>>
>>> Best Regards,
>>> Sergio Sota
>>>
>>> Here are our xorg.conf and /tmp/Xorg.0.log
>>>
>>> ==
>>> # Monitors represent physical monitors.

[linux-sunxi] [PATCH 2/2] media: cedrus: Fix H264 decoding

2020-12-23 Thread Jernej Skrabec
During H264 API overhaul subtle bug was introduced Cedrus driver.
Progressive references have both, top and bottom reference flags set.
Cedrus reference list expects only bottom reference flag and only when
interlaced frames are decoded. However, due to a bug in Cedrus check,
exclusivity is not tested and that flag is set also for progressive
references. That causes "jumpy" background with many videos.

Fix that by checking that only bottom reference flag is set in control
and nothing else.

Tested-by: Andre Heider 
Fixes: cfc8c3ed533e ("media: cedrus: h264: Properly configure reference field")
Signed-off-by: Jernej Skrabec 
---
 drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c 
b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
index 781c84a9b1b7..de7442d4834d 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
@@ -203,7 +203,7 @@ static void _cedrus_write_ref_list(struct cedrus_ctx *ctx,
position = cedrus_buf->codec.h264.position;
 
sram_array[i] |= position << 1;
-   if (ref_list[i].fields & V4L2_H264_BOTTOM_FIELD_REF)
+   if (ref_list[i].fields == V4L2_H264_BOTTOM_FIELD_REF)
sram_array[i] |= BIT(0);
}
 
-- 
2.29.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201223110659.2631255-3-jernej.skrabec%40siol.net.


[linux-sunxi] [PATCH 1/2] media: cedrus: Remove checking for required controls

2020-12-23 Thread Jernej Skrabec
According to v4l2 request api specifications, it's allowed to skip
control if its content isn't changed for performance reasons. Cedrus
driver predates that, so it has implemented mechanism to check if all
required controls are included in one request.

Conform to specifications with removing that mechanism.

Note that this mechanism with static required flag isn't very good
anyway because need for control is usually signaled in other controls.

Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver")
Signed-off-by: Jernej Skrabec 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c | 49 -
 drivers/staging/media/sunxi/cedrus/cedrus.h |  1 -
 2 files changed, 50 deletions(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index ddad5d274ee8..7bd9291c8d5f 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -34,56 +34,48 @@ static const struct cedrus_control cedrus_controls[] = {
.id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS,
},
.codec  = CEDRUS_CODEC_MPEG2,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION,
},
.codec  = CEDRUS_CODEC_MPEG2,
-   .required   = false,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_DECODE_PARAMS,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SLICE_PARAMS,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SPS,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_PPS,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SCALING_MATRIX,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = false,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_PRED_WEIGHTS,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = false,
},
{
.cfg = {
@@ -92,7 +84,6 @@ static const struct cedrus_control cedrus_controls[] = {
.def= V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = false,
},
{
.cfg = {
@@ -101,7 +92,6 @@ static const struct cedrus_control cedrus_controls[] = {
.def= V4L2_STATELESS_H264_START_CODE_NONE,
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = false,
},
/*
 * We only expose supported profiles information,
@@ -120,28 +110,24 @@ static const struct cedrus_control cedrus_controls[] = {
BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
},
.codec  = CEDRUS_CODEC_H264,
-   .required   = false,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_HEVC_SPS,
},
.codec  = CEDRUS_CODEC_H265,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_HEVC_PPS,
},
.codec  = CEDRUS_CODEC_H265,
-   .required   = true,
},
{
.cfg = {
.id = V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS,
},
.codec  = CEDRUS_CODEC_H265,
-   .required   = true,
},
{
.cfg = {
@@ -150,7 +136,6 @@ static const struct cedrus_control cedrus_controls[] = {
.def= V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED,
},
.codec  = CEDRUS_CODEC_H265,
-   .required   = false,
},
{
.cfg = {
@@ -159,14 +144,12 @@ static const struct cedrus_control cedrus_controls[] = {
.def= V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE,
},
 

[linux-sunxi] [PATCH 0/2] media: cedrus: a couple of fixes

2020-12-23 Thread Jernej Skrabec
This short series fixes two issues:
1. conformance to v4l2 request api specifications
2. regression in h264 video decoding introduced during h264 api rework

Please take a look.

Best regards,
Jernej

Jernej Skrabec (2):
  media: cedrus: Remove checking for required controls
  media: cedrus: Fix H264 decoding

 drivers/staging/media/sunxi/cedrus/cedrus.c   | 49 ---
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  1 -
 .../staging/media/sunxi/cedrus/cedrus_h264.c  |  2 +-
 3 files changed, 1 insertion(+), 51 deletions(-)

-- 
2.29.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201223110659.2631255-1-jernej.skrabec%40siol.net.