Re: [PATCH v2] Partially revert "video: fbdev: amba-clcd: Retire elder CLCD driver"

2020-09-30 Thread Daniel Vetter
On Tue, Sep 29, 2020 at 12:53:44PM -0700, Peter Collingbourne wrote:
> Also partially revert the follow-up change "drm: pl111: Absorb the
> external register header".
> 
> This reverts the parts of commits
> 7e4e589db76a3cf4c1f534eb5a09cc6422766b93 and
> 0fb8125635e8eb5483fb095f98dcf0651206a7b8 that touch paths outside
> of drivers/gpu/drm/pl111.
> 
> The fbdev driver is used by Android's FVP configuration. Using the
> DRM driver together with DRM's fbdev emulation results in a failure
> to boot Android. The root cause is that Android's generic fbdev
> userspace driver relies on the ability to set the pixel format via
> FBIOPUT_VSCREENINFO, which is not supported by fbdev emulation.
> 
> There have been other less critical behavioral differences identified
> between the fbdev driver and the DRM driver with fbdev emulation. The
> DRM driver exposes different values for the panel's width, height and
> refresh rate, and the DRM driver fails a FBIOPUT_VSCREENINFO syscall
> with yres_virtual greater than the maximum supported value instead
> of letting the syscall succeed and setting yres_virtual based on yres.
> 
> Signed-off-by: Peter Collingbourne 

Applied to drm-misc-fixes, should make it into Linus tree this week.
-Daniel

> ---
> View this change in Gerrit: 
> https://linux-review.googlesource.com/q/I2d7e59b0e693d9fec206d40df190c5aa02844b56
> 
>  MAINTAINERS |   5 +
>  drivers/video/fbdev/Kconfig |  20 +
>  drivers/video/fbdev/Makefile|   1 +
>  drivers/video/fbdev/amba-clcd.c | 986 
>  include/linux/amba/clcd-regs.h  |  87 +++
>  include/linux/amba/clcd.h   | 290 ++
>  6 files changed, 1389 insertions(+)
>  create mode 100644 drivers/video/fbdev/amba-clcd.c
>  create mode 100644 include/linux/amba/clcd-regs.h
>  create mode 100644 include/linux/amba/clcd.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 190c7fa2ea01..671c1fa79e64 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1460,6 +1460,11 @@ S: Odd Fixes
>  F:   drivers/amba/
>  F:   include/linux/amba/bus.h
>  
> +ARM PRIMECELL CLCD PL110 DRIVER
> +M:   Russell King 
> +S:   Odd Fixes
> +F:   drivers/video/fbdev/amba-clcd.*
> +
>  ARM PRIMECELL KMI PL050 DRIVER
>  M:   Russell King 
>  S:   Odd Fixes
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index b2c9dd4f0cb5..402e85450bb5 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -272,6 +272,26 @@ config FB_PM2_FIFO_DISCONNECT
>   help
> Support the Permedia2 FIFO disconnect feature.
>  
> +config FB_ARMCLCD
> + tristate "ARM PrimeCell PL110 support"
> + depends on ARM || ARM64 || COMPILE_TEST
> + depends on FB && ARM_AMBA && HAS_IOMEM
> + select FB_CFB_FILLRECT
> + select FB_CFB_COPYAREA
> + select FB_CFB_IMAGEBLIT
> + select FB_MODE_HELPERS if OF
> + select VIDEOMODE_HELPERS if OF
> + select BACKLIGHT_CLASS_DEVICE if OF
> + help
> +   This framebuffer device driver is for the ARM PrimeCell PL110
> +   Colour LCD controller.  ARM PrimeCells provide the building
> +   blocks for System on a Chip devices.
> +
> +   If you want to compile this as a module (=code which can be
> +   inserted into and removed from the running kernel), say M
> +   here and read .  The module
> +   will be called amba-clcd.
> +
>  config FB_ACORN
>   bool "Acorn VIDC support"
>   depends on (FB = y) && ARM && ARCH_ACORN
> diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
> index cad4fb64442a..a0705b99e643 100644
> --- a/drivers/video/fbdev/Makefile
> +++ b/drivers/video/fbdev/Makefile
> @@ -75,6 +75,7 @@ obj-$(CONFIG_FB_HIT)  += hitfb.o
>  obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o
>  obj-$(CONFIG_FB_PVR2) += pvr2fb.o
>  obj-$(CONFIG_FB_VOODOO1)  += sstfb.o
> +obj-$(CONFIG_FB_ARMCLCD)   += amba-clcd.o
>  obj-$(CONFIG_FB_GOLDFISH) += goldfishfb.o
>  obj-$(CONFIG_FB_68328)+= 68328fb.o
>  obj-$(CONFIG_FB_GBE)  += gbefb.o
> diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
> new file mode 100644
> index ..b7682de412d8
> --- /dev/null
> +++ b/drivers/video/fbdev/amba-clcd.c
> @@ -0,0 +1,986 @@
> +/*
> + *  linux/drivers/video/amba-clcd.c
> + *
> + * Copyright (C) 2001 ARM Limited, by David A Rusling
> + * Updated to 2.5, Deep Blue Solutions Ltd.
> + *
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file COPYING in the main directory of this archive
> + * for more details.
> + *
> + *  ARM PrimeCell PL110 Color LCD Controller
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define to_clcd(inf

Re: [PATCH v2] Partially revert "video: fbdev: amba-clcd: Retire elder CLCD driver"

2020-09-30 Thread Linus Walleij
On Tue, Sep 29, 2020 at 11:16 PM Peter Collingbourne  wrote:
> On Tue, Sep 29, 2020 at 1:33 PM Linus Walleij  
> wrote:

> > Can you also share the kernel config used for this build so it is
> > easy to rebuild a similar kernel?
>
> There are instructions here for how to build Android targeting FVP:
> https://cs.android.com/android/platform/superproject/+/master:device/generic/goldfish/fvpbase/README.md
>
> It also includes instructions for building the kernel (which is the
> Android common kernel so it does have some patches on top, but it does
> closely track mainline) so you should be able to make your changes on
> top of the common kernel, rebuild and test them that way.

OK I'll try it! It seems to assume the user is already familiar with the Android
build process in some sense, and I haven't built Android since 2012
or so, so I need some struggling to get up to speed.

Android being as it is I suppose it as usual also require quite a lot of
harddrive space to build, so I need to get hold of a computer with enough
space on it.

> Because of how Android boot images work I don't think it would be easy
> to provide binaries where you can replace the kernel image. Let me
> know if you have any trouble following the instructions.
>
> The configuration is basically a combination of these two configs:
> https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/arch/arm64/configs/gki_defconfig
> https://android-review.googlesource.com/c/kernel/common/+/1145352/11/fvp.fragment
>
> Those configs enable the fbdev driver. You can apply the patch I
> posted earlier to fvp.fragment to switch to the DRM driver.

Excellent thanks.

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] Partially revert "video: fbdev: amba-clcd: Retire elder CLCD driver"

2020-09-29 Thread Linus Walleij
On Tue, Sep 29, 2020 at 9:53 PM Peter Collingbourne  wrote:

> The fbdev driver is used by Android's FVP configuration. Using the
> DRM driver together with DRM's fbdev emulation results in a failure
> to boot Android. The root cause is that Android's generic fbdev
> userspace driver relies on the ability to set the pixel format via
> FBIOPUT_VSCREENINFO, which is not supported by fbdev emulation.
>
> There have been other less critical behavioral differences identified
> between the fbdev driver and the DRM driver with fbdev emulation. The
> DRM driver exposes different values for the panel's width, height and
> refresh rate, and the DRM driver fails a FBIOPUT_VSCREENINFO syscall
> with yres_virtual greater than the maximum supported value instead
> of letting the syscall succeed and setting yres_virtual based on yres.

Is there a way to reproduce this? A simple binary image where
we can start Android on FVP and just replace the kernel image
would be great. That way we can look at the incompatibilities
in the FBDEV emulation and try to fix them.

Is it working with a stock kernel or do you need any out-of-tree
Android patches to run this?

Can you also share the kernel config used for this build so it is
easy to rebuild a similar kernel?

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel