mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-14 12:21:53 +00:00
Update OpenWRT
This commit is contained in:
parent
55c3e7cde4
commit
948aebf05a
1080 changed files with 8134 additions and 328613 deletions
|
@ -1,2 +0,0 @@
|
|||
LINUX_VERSION-6.1 = .24
|
||||
LINUX_KERNEL_HASH-6.1.24 = aae6a7e38e33589011f5a5c0d7e087c8a26e3daf8d434432ee975ead90546504
|
|
@ -1,202 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
||||
KERNEL_MAKEOPTS_IMAGE += \
|
||||
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
||||
endif
|
||||
|
||||
INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt
|
||||
|
||||
ifneq (,$(KERNEL_CC))
|
||||
KERNEL_MAKEOPTS += CC="$(KERNEL_CC)"
|
||||
endif
|
||||
|
||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
|
||||
# defined in quilt.mk
|
||||
Kernel/Patch:=$(Kernel/Patch/Default)
|
||||
|
||||
ifneq (,$(findstring .xz,$(LINUX_SOURCE)))
|
||||
LINUX_CAT:=xzcat
|
||||
else
|
||||
LINUX_CAT:=gzip -dc
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
|
||||
ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
|
||||
define Kernel/Prepare/Default
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
$(Kernel/Patch)
|
||||
$(if $(QUILT),touch $(LINUX_DIR)/.quilt_used)
|
||||
endef
|
||||
else
|
||||
define Kernel/Prepare/Default
|
||||
$(LINUX_CAT) $(DL_DIR)/$(LINUX_SOURCE) | $(TAR) -C $(KERNEL_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
endif
|
||||
else
|
||||
define Kernel/Prepare/Default
|
||||
mkdir -p $(KERNEL_BUILD_DIR)
|
||||
if [ -d $(LINUX_DIR) ]; then \
|
||||
rmdir $(LINUX_DIR); \
|
||||
fi
|
||||
ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR)
|
||||
if [ -d $(LINUX_DIR)/user_headers ]; then \
|
||||
rm -rf $(LINUX_DIR)/user_headers; \
|
||||
fi
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_BLK_DEV_INITRD=y' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR) $(INITRAMFS_EXTRA_FILES))"' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
define Kernel/SetInitramfs/PreConfigure
|
||||
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
define Kernel/SetInitramfs
|
||||
rm -f $(LINUX_DIR)/.config.prev
|
||||
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
|
||||
$(call Kernel/SetInitramfs/PreConfigure)
|
||||
echo "# CONFIG_INITRAMFS_PRESERVE_MTIME is not set" >> $(LINUX_DIR)/.config
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
|
||||
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
|
||||
else
|
||||
echo "# CONFIG_INITRAMFS_FORCE is not set" >> $(LINUX_DIR)/.config
|
||||
endif
|
||||
echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),CONFIG_INITRAMFS_COMPRESSION_LZMA=y\nCONFIG_RD_LZMA=y,# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set\n# CONFIG_RD_LZMA is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),CONFIG_INITRAMFS_COMPRESSION_LZO=y\nCONFIG_RD_LZO=y,# CONFIG_INITRAMFS_COMPRESSION_LZO is not set\n# CONFIG_RD_LZO is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,# CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),CONFIG_INITRAMFS_COMPRESSION_LZ4=y\nCONFIG_RD_LZ4=y,# CONFIG_INITRAMFS_COMPRESSION_LZ4 is not set\n# CONFIG_RD_LZ4 is not set)" >> $(LINUX_DIR)/.config
|
||||
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),CONFIG_INITRAMFS_COMPRESSION_ZSTD=y\nCONFIG_RD_ZSTD=y,# CONFIG_INITRAMFS_COMPRESSION_ZSTD is not set\n# CONFIG_RD_ZSTD is not set)" >> $(LINUX_DIR)/.config
|
||||
endef
|
||||
else
|
||||
endif
|
||||
|
||||
define Kernel/SetNoInitramfs
|
||||
mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
|
||||
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
|
||||
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
|
||||
echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
|
||||
echo "# CONFIG_INITRAMFS_PRESERVE_MTIME is not set" >> $(LINUX_DIR)/.config.set
|
||||
endef
|
||||
|
||||
define Kernel/Configure/Default
|
||||
rm -f $(LINUX_DIR)/localversion
|
||||
$(LINUX_CONF_CMD) > $(LINUX_DIR)/.config.target
|
||||
# copy CONFIG_KERNEL_* settings over to .config.target
|
||||
awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' $(TOPDIR)/.config >> $(LINUX_DIR)/.config.target
|
||||
echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target
|
||||
echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target
|
||||
echo "CONFIG_KALLSYMS_UNCOMPRESSED=y" >> $(LINUX_DIR)/.config.target
|
||||
$(SCRIPT_DIR)/package-metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config $(KERNEL_PATCHVER) > $(LINUX_DIR)/.config.override
|
||||
$(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config.set
|
||||
$(call Kernel/SetNoInitramfs)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/modules
|
||||
cmp -s $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev || { \
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config; \
|
||||
cp $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.prev; \
|
||||
}
|
||||
$(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(KERNEL_MAKE) $(if $(findstring uml,$(BOARD)),ARCH=$(ARCH)) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
|
||||
grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
|
||||
endef
|
||||
|
||||
define Kernel/Configure/Initramfs
|
||||
$(call Kernel/SetInitramfs)
|
||||
endef
|
||||
|
||||
define Kernel/CompileModules/Default
|
||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
||||
+$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
# If .config did not change, use the previous timestamp to avoid package rebuilds
|
||||
cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \
|
||||
mv $(LINUX_DIR)/.config.modules.save $(LINUX_DIR)/.config; \
|
||||
$(CP) $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save
|
||||
endef
|
||||
|
||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
||||
|
||||
# AMD64 shares the location with x86
|
||||
ifeq ($(LINUX_KARCH),x86_64)
|
||||
IMAGES_DIR:=../../x86/boot
|
||||
endif
|
||||
|
||||
define Kernel/CopyImage
|
||||
cmp -s $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug || { \
|
||||
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1); \
|
||||
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
|
||||
$(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
|
||||
$(foreach k, \
|
||||
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out vmlinux dtbs,$(KERNELNAME))), \
|
||||
$(CP) $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/$(IMAGES_DIR)/$(k) $(KERNEL_BUILD_DIR)/$(k)$(1); \
|
||||
) \
|
||||
}
|
||||
endef
|
||||
|
||||
# Always add "modules" so a proper Module.symvers file is written that
|
||||
# also contains symbols from the kernel modules. Without these symbols
|
||||
# external packages that depend on exported symbols from kernel modules
|
||||
# will fail to build.
|
||||
define Kernel/CompileImage/Default
|
||||
rm -f $(TARGET_DIR)/init
|
||||
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
$(call Kernel/CopyImage)
|
||||
endef
|
||||
|
||||
# Here as well, always add "modules", see comment above.
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||
define Kernel/CompileImage/Initramfs
|
||||
$(call Kernel/Configure/Initramfs)
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),)
|
||||
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
|
||||
else
|
||||
( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
|
||||
endif
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),bzip2 -9 -c < $(KERNEL_BUILD_DIR)/initrd.cpio > $(KERNEL_BUILD_DIR)/initrd.cpio.bzip2)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),gzip -n -f -S .gzip -9n $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),$(STAGING_DIR_HOST)/bin/lzma e -lc1 -lp2 -pb2 $(KERNEL_BUILD_DIR)/initrd.cpio $(KERNEL_BUILD_DIR)/initrd.cpio.lzma)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),$(STAGING_DIR_HOST)/bin/xz -T$(if $(filter 1,$(NPROC)),2,0) -9 -fz --check=crc32 $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
# ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
|
||||
$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio)
|
||||
endif
|
||||
+$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
$(call Kernel/CopyImage,-initramfs)
|
||||
endef
|
||||
else
|
||||
define Kernel/CompileImage/Initramfs
|
||||
endef
|
||||
endif
|
||||
|
||||
define Kernel/Clean/Default
|
||||
rm -f $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/.configured
|
||||
rm -f $(LINUX_KERNEL)
|
||||
$(_SINGLE)$(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) clean
|
||||
endef
|
|
@ -1,662 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
FS_MENU:=Filesystems
|
||||
|
||||
define KernelPackage/fs-9p
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Plan 9 Resource Sharing Support
|
||||
DEPENDS:=+kmod-9pnet
|
||||
KCONFIG:=\
|
||||
CONFIG_9P_FS \
|
||||
CONFIG_9P_FS_POSIX_ACL=n \
|
||||
CONFIG_9P_FS_SECURITY=n \
|
||||
CONFIG_9P_FSCACHE=n
|
||||
FILES:=$(LINUX_DIR)/fs/9p/9p.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,9p)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-9p/description
|
||||
Kernel module for Plan 9 Resource Sharing Support support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-9p))
|
||||
|
||||
|
||||
define KernelPackage/fs-afs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Andrew FileSystem client
|
||||
DEFAULT:=n
|
||||
DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache
|
||||
KCONFIG:=\
|
||||
CONFIG_AFS_FS=m \
|
||||
CONFIG_AFS_DEBUG=n \
|
||||
CONFIG_AFS_FSCACHE=y
|
||||
FILES:=$(LINUX_DIR)/fs/afs/kafs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,kafs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-afs/description
|
||||
Kernel module for Andrew FileSystem client support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-afs))
|
||||
|
||||
define KernelPackage/fs-autofs4
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=AUTOFS4 filesystem support
|
||||
KCONFIG:= \
|
||||
CONFIG_AUTOFS4_FS \
|
||||
CONFIG_AUTOFS_FS
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/autofs/autofs4.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,autofs4)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-autofs4/description
|
||||
Kernel module for AutoFS4 support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-autofs4))
|
||||
|
||||
|
||||
define KernelPackage/fs-btrfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=BTRFS filesystem support
|
||||
DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +kmod-lib-zstd
|
||||
KCONFIG:=\
|
||||
CONFIG_BTRFS_FS \
|
||||
CONFIG_BTRFS_FS_CHECK_INTEGRITY=n
|
||||
FILES:=\
|
||||
$(LINUX_DIR)/fs/btrfs/btrfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,btrfs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-btrfs/description
|
||||
Kernel module for BTRFS support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-btrfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-cifs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=CIFS support
|
||||
KCONFIG:= \
|
||||
CONFIG_SMBFS_COMMON@ge5.15 \
|
||||
CONFIG_CIFS \
|
||||
CONFIG_CIFS_DFS_UPCALL=n \
|
||||
CONFIG_CIFS_UPCALL=n
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/smbfs_common/cifs_arc4.ko@ge5.15 \
|
||||
$(LINUX_DIR)/fs/smbfs_common/cifs_md4.ko@ge5.15 \
|
||||
$(LINUX_DIR)/fs/cifs/cifs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,cifs)
|
||||
$(call AddDepends/nls)
|
||||
DEPENDS+= \
|
||||
+(LINUX_5_4||LINUX_5_10):kmod-crypto-md4\
|
||||
+(LINUX_5_4||LINUX_5_10):kmod-crypto-arc4 \
|
||||
+kmod-crypto-md5 \
|
||||
+kmod-crypto-sha256 \
|
||||
+kmod-crypto-sha512 \
|
||||
+kmod-crypto-cmac \
|
||||
+kmod-crypto-hmac \
|
||||
+kmod-crypto-aead \
|
||||
+kmod-crypto-ccm \
|
||||
+kmod-crypto-ecb \
|
||||
+kmod-crypto-des \
|
||||
+(LINUX_5_15||LINUX_6_1):kmod-asn1-decoder \
|
||||
+(LINUX_5_15||LINUX_6_1):kmod-oid-registry \
|
||||
+(LINUX_5_15||LINUX_6_1):kmod-dnsresolver
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-cifs/description
|
||||
Kernel module for CIFS support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-cifs))
|
||||
|
||||
|
||||
define KernelPackage/fs-configfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Configuration filesystem support
|
||||
KCONFIG:= \
|
||||
CONFIG_CONFIGFS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/configfs/configfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,configfs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-configfs/description
|
||||
Kernel module for configfs support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-configfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-cramfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Compressed RAM/ROM filesystem support
|
||||
DEPENDS:=+kmod-lib-zlib-inflate
|
||||
KCONFIG:= \
|
||||
CONFIG_CRAMFS
|
||||
FILES:=$(LINUX_DIR)/fs/cramfs/cramfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,cramfs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-cramfs/description
|
||||
Kernel module for cramfs support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-cramfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-efivarfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=efivar filesystem support
|
||||
KCONFIG:=CONFIG_EFIVAR_FS
|
||||
FILES:=$(LINUX_DIR)/fs/efivarfs/efivarfs.ko
|
||||
DEPENDS:=@(x86_64||x86)
|
||||
AUTOLOAD:=$(call Autoload,90,efivarfs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-efivarfs/description
|
||||
Kernel module to support efivarfs file system mountpoint.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-efivarfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-exfat
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=exFAT filesystem support
|
||||
KCONFIG:= \
|
||||
CONFIG_EXFAT_FS \
|
||||
CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/staging/exfat/exfat.ko@lt5.7 \
|
||||
$(LINUX_DIR)/fs/exfat/exfat.ko@ge5.7
|
||||
AUTOLOAD:=$(call AutoLoad,30,exfat,1)
|
||||
DEPENDS:=+kmod-nls-base
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-exfat/description
|
||||
Kernel module for exFAT filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-exfat))
|
||||
|
||||
|
||||
define KernelPackage/fs-exportfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=exportfs kernel server support
|
||||
KCONFIG:=CONFIG_EXPORTFS
|
||||
FILES=$(LINUX_DIR)/fs/exportfs/exportfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,20,exportfs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-exportfs/description
|
||||
Kernel module for exportfs. Needed for some other modules.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-exportfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-ext4
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=EXT4 filesystem support
|
||||
DEPENDS := \
|
||||
+kmod-lib-crc16 \
|
||||
+kmod-crypto-hash \
|
||||
+kmod-crypto-crc32c
|
||||
KCONFIG:= \
|
||||
CONFIG_EXT4_FS \
|
||||
CONFIG_EXT4_ENCRYPTION=n \
|
||||
CONFIG_JBD2
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/ext4/ext4.ko \
|
||||
$(LINUX_DIR)/fs/jbd2/jbd2.ko \
|
||||
$(LINUX_DIR)/fs/mbcache.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,mbcache jbd2 ext4,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-ext4/description
|
||||
Kernel module for EXT4 filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-ext4))
|
||||
|
||||
|
||||
define KernelPackage/fs-f2fs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=F2FS filesystem support
|
||||
DEPENDS:= +kmod-crypto-hash +kmod-crypto-crc32 +kmod-nls-base
|
||||
KCONFIG:=CONFIG_F2FS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/f2fs/f2fs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,f2fs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-f2fs/description
|
||||
Kernel module for F2FS filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-f2fs))
|
||||
|
||||
|
||||
define KernelPackage/fs-netfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Network Filesystems support
|
||||
DEPENDS:=@LINUX_5_15
|
||||
KCONFIG:= CONFIG_NETFS_SUPPORT
|
||||
FILES:=$(LINUX_DIR)/fs/netfs/netfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,28,netfs)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-netfs))
|
||||
|
||||
define KernelPackage/fs-fscache
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=General filesystem local cache manager
|
||||
DEPENDS:=+kmod-fs-netfs
|
||||
KCONFIG:=\
|
||||
CONFIG_FSCACHE=m \
|
||||
CONFIG_FSCACHE_STATS=y \
|
||||
CONFIG_FSCACHE_HISTOGRAM=n \
|
||||
CONFIG_FSCACHE_DEBUG=n \
|
||||
CONFIG_FSCACHE_OBJECT_LIST=n \
|
||||
CONFIG_CACHEFILES=y \
|
||||
CONFIG_CACHEFILES_DEBUG=n \
|
||||
CONFIG_CACHEFILES_HISTOGRAM=n
|
||||
FILES:=$(LINUX_DIR)/fs/fscache/fscache.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,fscache)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-fscache))
|
||||
|
||||
|
||||
define KernelPackage/fs-hfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=HFS filesystem support
|
||||
DEPENDS:=+kmod-cdrom
|
||||
KCONFIG:=CONFIG_HFS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/hfs/hfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,hfs)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-hfs/description
|
||||
Kernel module for HFS filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-hfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-hfsplus
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=HFS+ filesystem support
|
||||
DEPENDS:=+kmod-cdrom
|
||||
KCONFIG:=CONFIG_HFSPLUS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/hfsplus/hfsplus.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,hfsplus)
|
||||
$(call AddDepends/nls,utf8)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-hfsplus/description
|
||||
Kernel module for HFS+ filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-hfsplus))
|
||||
|
||||
|
||||
define KernelPackage/fs-isofs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=ISO9660 filesystem support
|
||||
DEPENDS:=+kmod-lib-zlib-inflate +kmod-cdrom
|
||||
KCONFIG:=CONFIG_ISO9660_FS CONFIG_JOLIET=y CONFIG_ZISOFS=n
|
||||
FILES:=$(LINUX_DIR)/fs/isofs/isofs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,isofs)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-isofs/description
|
||||
Kernel module for ISO9660 filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-isofs))
|
||||
|
||||
|
||||
define KernelPackage/fs-jfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=JFS filesystem support
|
||||
KCONFIG:=CONFIG_JFS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/jfs/jfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,jfs,1)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-jfs/description
|
||||
Kernel module for JFS support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-jfs))
|
||||
|
||||
define KernelPackage/fs-minix
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Minix filesystem support
|
||||
KCONFIG:=CONFIG_MINIX_FS
|
||||
FILES:=$(LINUX_DIR)/fs/minix/minix.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,minix)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-minix/description
|
||||
Kernel module for Minix filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-minix))
|
||||
|
||||
|
||||
define KernelPackage/fs-msdos
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=MSDOS filesystem support
|
||||
DEPENDS:=+kmod-fs-vfat
|
||||
KCONFIG:=CONFIG_MSDOS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/fat/msdos.ko
|
||||
AUTOLOAD:=$(call AutoLoad,40,msdos)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-msdos/description
|
||||
Kernel module for MSDOS filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-msdos))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NFS filesystem client support
|
||||
DEPENDS:=+kmod-fs-nfs-common +kmod-dnsresolver +!LINUX_5_4:kmod-fs-nfs-ssc
|
||||
KCONFIG:= \
|
||||
CONFIG_NFS_FS \
|
||||
CONFIG_NFS_USE_LEGACY_DNS=n \
|
||||
CONFIG_NFS_USE_NEW_IDMAPPER=n
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/nfs/nfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,40,nfs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-nfs/description
|
||||
Kernel module for NFS client support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs-ssc
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Common NFS filesystem SSC Helper module
|
||||
KCONFIG:= CONFIG_NFS_V4_2@ge5.10
|
||||
FILES:= $(LINUX_DIR)/fs/nfs_common/nfs_ssc.ko@ge5.10
|
||||
AUTOLOAD:=$(call AutoLoad,30,nfs_ssc)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs-ssc))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs-common
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Common NFS filesystem modules
|
||||
DEPENDS:=+kmod-oid-registry
|
||||
KCONFIG:= \
|
||||
CONFIG_LOCKD \
|
||||
CONFIG_SUNRPC \
|
||||
CONFIG_GRACE_PERIOD
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/lockd/lockd.ko \
|
||||
$(LINUX_DIR)/net/sunrpc/sunrpc.ko \
|
||||
$(LINUX_DIR)/fs/nfs_common/grace.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,grace sunrpc lockd)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs-common))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs-common-rpcsec
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NFS Secure RPC
|
||||
DEPENDS:= \
|
||||
+kmod-fs-nfs-common \
|
||||
+kmod-crypto-des \
|
||||
+kmod-crypto-cbc \
|
||||
+kmod-crypto-cts \
|
||||
+kmod-crypto-md5 \
|
||||
+kmod-crypto-sha1 \
|
||||
+kmod-crypto-hmac \
|
||||
+kmod-crypto-ecb \
|
||||
+kmod-crypto-arc4 \
|
||||
+kmod-oid-registry
|
||||
KCONFIG:= \
|
||||
CONFIG_SUNRPC_GSS \
|
||||
CONFIG_RPCSEC_GSS_KRB5
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko \
|
||||
$(LINUX_DIR)/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
|
||||
AUTOLOAD:=$(call AutoLoad,31,auth_rpcgss rpcsec_gss_krb5)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-nfs-common-rpcsec/description
|
||||
Kernel modules for NFS Secure RPC
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs-common-rpcsec))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs-v3
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NFS3 filesystem client support
|
||||
DEPENDS:=+kmod-fs-nfs
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/nfs/nfsv3.ko
|
||||
AUTOLOAD:=$(call AutoLoad,41,nfsv3)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-nfs-v3/description
|
||||
Kernel module for NFS v3 client support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs-v3))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfs-v4
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NFS4 filesystem client support
|
||||
DEPENDS:=+kmod-fs-nfs +!LINUX_5_4:kmod-fs-nfs-ssc
|
||||
KCONFIG:= \
|
||||
CONFIG_NFS_V4=y
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/nfs/nfsv4.ko
|
||||
AUTOLOAD:=$(call AutoLoad,41,nfsv4)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-nfs-v4/description
|
||||
Kernel module for NFS v4 client support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfs-v4))
|
||||
|
||||
|
||||
define KernelPackage/fs-nfsd
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NFS kernel server support
|
||||
DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs +kmod-fs-nfs-common-rpcsec
|
||||
KCONFIG:= \
|
||||
CONFIG_NFSD \
|
||||
CONFIG_NFSD_V4=y \
|
||||
CONFIG_NFSD_V4_SECURITY_LABEL=n \
|
||||
CONFIG_NFSD_BLOCKLAYOUT=n \
|
||||
CONFIG_NFSD_SCSILAYOUT=n \
|
||||
CONFIG_NFSD_FLEXFILELAYOUT=n \
|
||||
CONFIG_NFSD_FAULT_INJECTION=n
|
||||
FILES:=$(LINUX_DIR)/fs/nfsd/nfsd.ko
|
||||
AUTOLOAD:=$(call AutoLoad,40,nfsd)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-nfsd/description
|
||||
Kernel module for NFS kernel server support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-nfsd))
|
||||
|
||||
|
||||
define KernelPackage/fs-ntfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NTFS filesystem support
|
||||
KCONFIG:=CONFIG_NTFS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/ntfs/ntfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,ntfs)
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-ntfs/description
|
||||
Kernel module for NTFS filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-ntfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-ntfs3
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=NTFS3 Read-Write file system support
|
||||
DEPENDS:= +kmod-nls-base
|
||||
KCONFIG:= \
|
||||
CONFIG_NTFS3_FS \
|
||||
CONFIG_NTFS3_64BIT_CLUSTER=y \
|
||||
CONFIG_NTFS3_LZX_XPRESS=y \
|
||||
CONFIG_NTFS3_FS_POSIX_ACL=y
|
||||
FILES:=$(LINUX_DIR)/fs/ntfs3/ntfs3.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,ntfs3)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-ntfs3/description
|
||||
Kernel module for NTFS3 filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-ntfs3))
|
||||
|
||||
|
||||
define KernelPackage/fs-reiserfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=ReiserFS filesystem support
|
||||
KCONFIG:=CONFIG_REISERFS_FS
|
||||
FILES:=$(LINUX_DIR)/fs/reiserfs/reiserfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,reiserfs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-reiserfs/description
|
||||
Kernel module for ReiserFS support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-reiserfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-squashfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=SquashFS 4.0 filesystem support
|
||||
KCONFIG:=CONFIG_SQUASHFS \
|
||||
CONFIG_SQUASHFS_XZ=y
|
||||
FILES:=$(LINUX_DIR)/fs/squashfs/squashfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,squashfs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-squashfs/description
|
||||
Kernel module for SquashFS 4.0 support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-squashfs))
|
||||
|
||||
|
||||
define KernelPackage/fs-udf
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=UDF filesystem support
|
||||
KCONFIG:=CONFIG_UDF_FS
|
||||
FILES:=$(LINUX_DIR)/fs/udf/udf.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,udf)
|
||||
DEPENDS:=+kmod-lib-crc-itu-t +kmod-cdrom
|
||||
$(call AddDepends/nls)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-udf/description
|
||||
Kernel module for UDF filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-udf))
|
||||
|
||||
|
||||
define KernelPackage/fs-vfat
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=VFAT filesystem support
|
||||
KCONFIG:= \
|
||||
CONFIG_FAT_FS \
|
||||
CONFIG_VFAT_FS
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/fs/fat/fat.ko \
|
||||
$(LINUX_DIR)/fs/fat/vfat.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,fat vfat)
|
||||
$(call AddDepends/nls,cp437 iso8859-1 utf8)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-vfat/description
|
||||
Kernel module for VFAT filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-vfat))
|
||||
|
||||
|
||||
define KernelPackage/fs-virtiofs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=Virtiofs filesystem support
|
||||
DEPENDS:=+kmod-fuse
|
||||
KCONFIG:=CONFIG_VIRTIO_FS
|
||||
FILES:=$(LINUX_DIR)/fs/fuse/virtiofs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,virtiofs)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-virtiofs/description
|
||||
Kernel module for Virtiofs filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-virtiofs))
|
||||
|
||||
|
||||
define KernelPackage/fs-xfs
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=XFS filesystem support
|
||||
KCONFIG:=CONFIG_XFS_FS
|
||||
DEPENDS:= +kmod-fs-exportfs +kmod-lib-crc32c
|
||||
FILES:=$(LINUX_DIR)/fs/xfs/xfs.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,xfs,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/fs-xfs/description
|
||||
Kernel module for XFS support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fs-xfs))
|
||||
|
||||
|
||||
define KernelPackage/fuse
|
||||
SUBMENU:=$(FS_MENU)
|
||||
TITLE:=FUSE (Filesystem in Userspace) support
|
||||
KCONFIG:= CONFIG_FUSE_FS
|
||||
FILES:=$(LINUX_DIR)/fs/fuse/fuse.ko
|
||||
AUTOLOAD:=$(call AutoLoad,80,fuse)
|
||||
endef
|
||||
|
||||
define KernelPackage/fuse/description
|
||||
Kernel module for userspace filesystem support
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fuse))
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,458 +0,0 @@
|
|||
CONFIG_64BIT=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_GIC_V3_ITS_PCI=y
|
||||
# CONFIG_ARM_MHU_V2 is not set
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
|
||||
CONFIG_ARM_TIMER_SP804=y
|
||||
CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
# CONFIG_BCM2711_THERMAL is not set
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
# CONFIG_BCM2835_SMI is not set
|
||||
CONFIG_BCM2835_THERMAL=y
|
||||
CONFIG_BCM2835_VCHIQ=y
|
||||
# CONFIG_BCM2835_VCHIQ_MMAL is not set
|
||||
CONFIG_BCM2835_WDT=y
|
||||
CONFIG_BCM_VCIO=y
|
||||
# CONFIG_BCM_VC_SM_CMA is not set
|
||||
CONFIG_BCM_VIDEOCORE=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BRCMSTB_L2_IRQ=y
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_CAVIUM_ERRATUM_22375=y
|
||||
CONFIG_CAVIUM_ERRATUM_23154=y
|
||||
CONFIG_CAVIUM_ERRATUM_27456=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
CONFIG_CLK_RASPBERRYPI=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMA=y
|
||||
CONFIG_CMA_ALIGNMENT=8
|
||||
CONFIG_CMA_AREAS=7
|
||||
# CONFIG_CMA_DEBUG is not set
|
||||
# CONFIG_CMA_DEBUGFS is not set
|
||||
CONFIG_CMA_SIZE_MBYTES=5
|
||||
# CONFIG_CMA_SIZE_SEL_MAX is not set
|
||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_CTS=y
|
||||
CONFIG_CRYPTO_DRBG=y
|
||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
||||
CONFIG_CRYPTO_DRBG_MENU=y
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
CONFIG_CRYPTO_SEQIV=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
CONFIG_DMABUF_HEAPS_SYSTEM=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BCM2708=y
|
||||
CONFIG_DMA_BCM2835=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
CONFIG_EXTCON=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_BCM2708=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FREEZER=y
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
CONFIG_FS_ENCRYPTION=y
|
||||
CONFIG_FS_ENCRYPTION_ALGS=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_BCM2835=y
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_KEYS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_PWM=y
|
||||
CONFIG_LEDS_TRIGGER_ACTPWR=y
|
||||
CONFIG_LEDS_TRIGGER_INPUT=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_MAC_PARTITION=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MAILBOX=y
|
||||
# CONFIG_MAILBOX_TEST is not set
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MICROCHIP_PHY=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
# CONFIG_MMC_BCM2835 is not set
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
CONFIG_MMC_BCM2835_SDHOST=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_BLOCK_MINORS=32
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
|
||||
CONFIG_MMC_SDHCI_IPROC=y
|
||||
# CONFIG_MMC_SDHCI_PCI is not set
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
# CONFIG_MTD is not set
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NOP_USB_XCEIV=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
CONFIG_OF_DYNAMIC=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_OVERLAY=y
|
||||
CONFIG_OF_RESOLVE=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
# CONFIG_PCIE_BRCMSTB is not set
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM2835=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_REGULATOR_GPIO=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
# CONFIG_RESET_RASPBERRYPI is not set
|
||||
CONFIG_RESET_SIMPLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
# CONFIG_RPIVID_MEM is not set
|
||||
# CONFIG_RPI_POE_POWER is not set
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_SERIAL_8250_BCM2835AUX=y
|
||||
# CONFIG_SERIAL_8250_DMA is not set
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=1
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=0
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SERIAL_DEV_BUS=y
|
||||
# CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SMSC_PHY=y
|
||||
# CONFIG_SND_BCM2835 is not set
|
||||
# CONFIG_SND_BCM2835_SOC_I2S is not set
|
||||
# CONFIG_SND_RPI_SIMPLE_SOUNDCARD is not set
|
||||
# CONFIG_SND_RPI_WM8804_SOUNDCARD is not set
|
||||
# CONFIG_SND_SOC_I_SABRE_CODEC is not set
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
CONFIG_SUSPEND=y
|
||||
CONFIG_SUSPEND_FREEZER=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TEXTSEARCH is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
CONFIG_UEVENT_HELPER_PATH=""
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
||||
CONFIG_USB_COMMON=y
|
||||
CONFIG_USB_DWCOTG=y
|
||||
CONFIG_USB_LAN78XX=y
|
||||
CONFIG_USB_NET_DRIVERS=y
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
CONFIG_USB_PHY=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_USB_USBNET=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_VT_CONSOLE_SLEEP=y
|
||||
CONFIG_VT_HW_CONSOLE_BINDING=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XZ_DEC_ARM=y
|
||||
CONFIG_XZ_DEC_BCJ=y
|
||||
CONFIG_ZONE_DMA32=y
|
|
@ -1,472 +0,0 @@
|
|||
CONFIG_64BIT=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_ARCH_BCM=y
|
||||
CONFIG_ARCH_BCM2835=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_CNP=y
|
||||
CONFIG_ARM64_CRYPTO=y
|
||||
CONFIG_ARM64_EPAN=y
|
||||
CONFIG_ARM64_ERRATUM_819472=y
|
||||
CONFIG_ARM64_ERRATUM_824069=y
|
||||
CONFIG_ARM64_ERRATUM_826319=y
|
||||
CONFIG_ARM64_ERRATUM_827319=y
|
||||
CONFIG_ARM64_ERRATUM_832075=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_HW_AFDBM=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_MODULE_PLTS=y
|
||||
CONFIG_ARM64_PAGE_SHIFT=12
|
||||
CONFIG_ARM64_PAN=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PTR_AUTH=y
|
||||
CONFIG_ARM64_PTR_AUTH_KERNEL=y
|
||||
CONFIG_ARM64_SVE=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_GIC_V3_ITS_PCI=y
|
||||
# CONFIG_ARM_MHU_V2 is not set
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
|
||||
CONFIG_ARM_TIMER_SP804=y
|
||||
CONFIG_ASSOCIATIVE_ARRAY=y
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BCM2708_VCMEM=y
|
||||
CONFIG_BCM2711_THERMAL=y
|
||||
CONFIG_BCM2835_DEVGPIOMEM=y
|
||||
CONFIG_BCM2835_MBOX=y
|
||||
CONFIG_BCM2835_POWER=y
|
||||
# CONFIG_BCM2835_SMI is not set
|
||||
# CONFIG_BCM2835_THERMAL is not set
|
||||
CONFIG_BCM2835_VCHIQ=y
|
||||
# CONFIG_BCM2835_VCHIQ_MMAL is not set
|
||||
CONFIG_BCM2835_WDT=y
|
||||
CONFIG_BCM7XXX_PHY=y
|
||||
CONFIG_BCMGENET=y
|
||||
CONFIG_BCM_NET_PHYLIB=y
|
||||
CONFIG_BCM_VCIO=y
|
||||
# CONFIG_BCM_VC_SM_CMA is not set
|
||||
CONFIG_BCM_VIDEOCORE=y
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BRCMSTB_L2_IRQ=y
|
||||
CONFIG_BRCM_CHAR_DRIVERS=y
|
||||
CONFIG_BROADCOM_PHY=y
|
||||
CONFIG_CAVIUM_ERRATUM_22375=y
|
||||
CONFIG_CAVIUM_ERRATUM_23154=y
|
||||
CONFIG_CAVIUM_ERRATUM_27456=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLKSRC_MMIO=y
|
||||
CONFIG_CLK_BCM2711_DVP=y
|
||||
CONFIG_CLK_BCM2835=y
|
||||
CONFIG_CLK_RASPBERRYPI=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMA=y
|
||||
CONFIG_CMA_ALIGNMENT=8
|
||||
CONFIG_CMA_AREAS=7
|
||||
# CONFIG_CMA_DEBUG is not set
|
||||
# CONFIG_CMA_DEBUGFS is not set
|
||||
CONFIG_CMA_SIZE_MBYTES=5
|
||||
# CONFIG_CMA_SIZE_SEL_MAX is not set
|
||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
||||
# CONFIG_CMA_SYSFS is not set
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_XGENE=y
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_CONTIG_ALLOC=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
||||
CONFIG_CPU_PM=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRYPTO_AES_ARM64=y
|
||||
CONFIG_CRYPTO_AES_ARM64_BS=y
|
||||
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
|
||||
CONFIG_CRYPTO_BLAKE2S=y
|
||||
CONFIG_CRYPTO_CBC=y
|
||||
CONFIG_CRYPTO_CRC32=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_CRYPTD=y
|
||||
CONFIG_CRYPTO_CTS=y
|
||||
CONFIG_CRYPTO_DRBG=y
|
||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
||||
CONFIG_CRYPTO_DRBG_MENU=y
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
CONFIG_CRYPTO_SEQIV=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA256_ARM64=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_SHA512_ARM64=y
|
||||
CONFIG_CRYPTO_SIMD=y
|
||||
CONFIG_CRYPTO_XTS=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_BUGVERBOSE=y
|
||||
CONFIG_DIMLIB=y
|
||||
CONFIG_DMABUF_HEAPS=y
|
||||
CONFIG_DMABUF_HEAPS_CMA=y
|
||||
CONFIG_DMABUF_HEAPS_SYSTEM=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BCM2708=y
|
||||
CONFIG_DMA_BCM2835=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_REMAP=y
|
||||
CONFIG_DMA_SHARED_BUFFER=y
|
||||
CONFIG_DMA_VIRTUAL_CHANNELS=y
|
||||
CONFIG_DNOTIFY=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_EXT4_FS_POSIX_ACL=y
|
||||
CONFIG_EXT4_FS_SECURITY=y
|
||||
CONFIG_EXTCON=y
|
||||
CONFIG_F2FS_FS=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_BCM2708=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_CMDLINE=y
|
||||
# CONFIG_FB_RPISENSE is not set
|
||||
CONFIG_FB_SIMPLE=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FONT_8x16=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_SUPPORT=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FREEZER=y
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
CONFIG_FS_ENCRYPTION=y
|
||||
CONFIG_FS_ENCRYPTION_ALGS=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FS_POSIX_ACL=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_FIND_FIRST_BIT=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_MIGRATION=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_BCM_VIRT=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
# CONFIG_GPIO_FSM is not set
|
||||
CONFIG_GPIO_RASPBERRYPI_EXP=y
|
||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HW_RANDOM_BCM2835 is not set
|
||||
CONFIG_HW_RANDOM_IPROC_RNG200=y
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_KEYS=y
|
||||
CONFIG_LEDS_GPIO=y
|
||||
CONFIG_LEDS_PWM=y
|
||||
CONFIG_LEDS_TRIGGER_ACTPWR=y
|
||||
CONFIG_LEDS_TRIGGER_INPUT=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_MAC_PARTITION=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_MAILBOX=y
|
||||
# CONFIG_MAILBOX_TEST is not set
|
||||
CONFIG_MDIO_BCM_UNIMAC=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MEMORY_ISOLATION=y
|
||||
CONFIG_MFD_CORE=y
|
||||
# CONFIG_MFD_RASPBERRYPI_POE_HAT is not set
|
||||
# CONFIG_MFD_RPISENSE_CORE is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BCM2835=y
|
||||
CONFIG_MMC_BCM2835_DMA=y
|
||||
CONFIG_MMC_BCM2835_MMC=y
|
||||
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
|
||||
CONFIG_MMC_BCM2835_SDHOST=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_BLOCK_MINORS=32
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_IO_ACCESSORS=y
|
||||
CONFIG_MMC_SDHCI_IPROC=y
|
||||
# CONFIG_MMC_SDHCI_PCI is not set
|
||||
CONFIG_MMC_SDHCI_PLTFM=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
# CONFIG_MTD is not set
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
CONFIG_NET_PTP_CLASSIFY=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NOP_USB_XCEIV=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_CONFIGFS=y
|
||||
CONFIG_OF_DYNAMIC=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OF_OVERLAY=y
|
||||
CONFIG_OF_RESOLVE=y
|
||||
CONFIG_PADATA=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCIE_BRCMSTB=y
|
||||
CONFIG_PCIE_PME=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_BCM2835=y
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_GENERIC_DOMAINS=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_OF=y
|
||||
CONFIG_PM_GENERIC_DOMAINS_SLEEP=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_PM_SLEEP=y
|
||||
CONFIG_PM_SLEEP_SMP=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PPS=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_PTP_1588_CLOCK=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_BCM2835=y
|
||||
CONFIG_PWM_SYSFS=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||
CONFIG_RASPBERRYPI_POWER=y
|
||||
CONFIG_RATIONAL=y
|
||||
# CONFIG_RAVE_SP_CORE is not set
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_REGULATOR_GPIO=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RESET_RASPBERRYPI=y
|
||||
CONFIG_RESET_SIMPLE=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
# CONFIG_RPIVID_MEM is not set
|
||||
# CONFIG_RPI_POE_POWER is not set
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_SCSI_COMMON=y
|
||||
# CONFIG_SCSI_LOWLEVEL is not set
|
||||
# CONFIG_SCSI_PROC_FS is not set
|
||||
CONFIG_SERIAL_8250_BCM2835AUX=y
|
||||
# CONFIG_SERIAL_8250_DMA is not set
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=1
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=0
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_SERIAL_DEV_BUS=y
|
||||
# CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SMP=y
|
||||
# CONFIG_SND_BCM2835 is not set
|
||||
# CONFIG_SND_BCM2835_SOC_I2S is not set
|
||||
# CONFIG_SND_RPI_SIMPLE_SOUNDCARD is not set
|
||||
# CONFIG_SND_RPI_WM8804_SOUNDCARD is not set
|
||||
# CONFIG_SND_SOC_I_SABRE_CODEC is not set
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
CONFIG_SUSPEND=y
|
||||
CONFIG_SUSPEND_FREEZER=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TEXTSEARCH is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THERMAL_WRITABLE_TRIPS=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
# CONFIG_UCLAMP_TASK is not set
|
||||
CONFIG_UEVENT_HELPER_PATH=""
|
||||
CONFIG_UNMAP_KERNEL_AT_EL0=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
||||
CONFIG_USB_COMMON=y
|
||||
CONFIG_USB_DWCOTG=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_PCI=y
|
||||
CONFIG_USB_PHY=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USB_UAS=y
|
||||
# CONFIG_USB_UHCI_HCD is not set
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_PCI=y
|
||||
CONFIG_USB_XHCI_PLATFORM=y
|
||||
CONFIG_VCHIQ_CDEV=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_VT_CONSOLE_SLEEP=y
|
||||
CONFIG_VT_HW_CONSOLE_BINDING=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XZ_DEC_ARM=y
|
||||
CONFIG_XZ_DEC_BCJ=y
|
||||
CONFIG_ZONE_DMA32=y
|
|
@ -1,37 +0,0 @@
|
|||
From 9d0a4eb1fe26868124687495e32a0567317d2c02 Mon Sep 17 00:00:00 2001
|
||||
From: Joerg Quinten <aBUGSworstnightmare@gmail.com>
|
||||
Date: Fri, 18 Jun 2021 13:02:29 +0200
|
||||
Subject: [PATCH 001/726] Support RPi DPI interface in mode6 for 18-bit color
|
||||
|
||||
A matching media bus format was added and an overlay for using it,
|
||||
both with FB and VC4 was added as well.
|
||||
|
||||
Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dpi.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
index 61ef7d232a12..8ba53af107f8 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
@@ -170,10 +170,16 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
|
||||
dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR,
|
||||
DPI_ORDER);
|
||||
break;
|
||||
+ case MEDIA_BUS_FMT_BGR666_1X24_CPADHI:
|
||||
+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
|
||||
+ fallthrough;
|
||||
case MEDIA_BUS_FMT_RGB666_1X24_CPADHI:
|
||||
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2,
|
||||
DPI_FORMAT);
|
||||
break;
|
||||
+ case MEDIA_BUS_FMT_BGR666_1X18:
|
||||
+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
|
||||
+ fallthrough;
|
||||
case MEDIA_BUS_FMT_RGB666_1X18:
|
||||
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
|
||||
DPI_FORMAT);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
From 159ab216c1f7f23bf8db8103090b02d026fc6f51 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 19 May 2020 16:20:30 +0100
|
||||
Subject: [PATCH 002/726] drm/vc4: Add FKMS as an acceptable node for dma
|
||||
ranges.
|
||||
|
||||
Under FKMS, the firmware (via FKMS) also requires the VideoCore cache
|
||||
aliases for image planes, as defined by the dma-ranges under /soc.
|
||||
|
||||
Add rpi-firmware-kms to the list of acceptable nodes to look for
|
||||
to copy dma config from.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_drv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
index 8c329c071c62..5a1c2f3ded30 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
@@ -276,6 +276,7 @@ static void vc4_component_unbind_all(void *ptr)
|
||||
static const struct of_device_id vc4_dma_range_matches[] = {
|
||||
{ .compatible = "brcm,bcm2711-hvs" },
|
||||
{ .compatible = "brcm,bcm2835-hvs" },
|
||||
+ { .compatible = "raspberrypi,rpi-firmware-kms" },
|
||||
{ .compatible = "brcm,bcm2835-v3d" },
|
||||
{ .compatible = "brcm,cygnus-v3d" },
|
||||
{ .compatible = "brcm,vc4-v3d" },
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 3467910104cb9db5265b15fc028ca762f6d59a65 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 26 Oct 2020 12:38:27 +0000
|
||||
Subject: [PATCH 003/726] drm/vc4: Add the 2711 HVS as a suitable DMA node
|
||||
|
||||
With vc4-drv node not being under /soc on Pi4, we need to
|
||||
adopt the correct DMA parameters from a suitable sub-component.
|
||||
Add "brcm,bcm2711-hvs" to that list of components.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_drv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
index 5a1c2f3ded30..f8053b591317 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
|
||||
@@ -276,6 +276,7 @@ static void vc4_component_unbind_all(void *ptr)
|
||||
static const struct of_device_id vc4_dma_range_matches[] = {
|
||||
{ .compatible = "brcm,bcm2711-hvs" },
|
||||
{ .compatible = "brcm,bcm2835-hvs" },
|
||||
+ { .compatible = "brcm,bcm2711-hvs" },
|
||||
{ .compatible = "raspberrypi,rpi-firmware-kms" },
|
||||
{ .compatible = "brcm,bcm2835-v3d" },
|
||||
{ .compatible = "brcm,cygnus-v3d" },
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From 3740f85fed2a9bc05b8f5bf25e02182ec14a4f40 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 12 Feb 2021 17:31:37 +0000
|
||||
Subject: [PATCH 004/726] drm/vc4: Change the default DPI format to being
|
||||
18bpp, not 24.
|
||||
|
||||
DPI hasn't really been used up until now, so the default has
|
||||
been meaningless.
|
||||
In theory we should be able to pass the desired format for the
|
||||
adjacent bridge chip through, but framework seems to be missing
|
||||
for that.
|
||||
|
||||
As the main device to use DPI is the VGA666 or Adafruit Kippah,
|
||||
both of which use RGB666, change the default to being RGB666 instead
|
||||
of RGB888.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dpi.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
index 8ba53af107f8..96b5d34f6bd7 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
@@ -150,8 +150,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
|
||||
}
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
|
||||
- /* Default to 24bit if no connector or format found. */
|
||||
- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT);
|
||||
+ /* Default to 18bit if no connector or format found. */
|
||||
+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT);
|
||||
|
||||
if (connector) {
|
||||
if (connector->display_info.num_bus_formats) {
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 61d0d869ff9c1ba175e7711330cf227b7640f7b2 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 7 Jan 2021 16:30:55 +0000
|
||||
Subject: [PATCH 005/726] drm/atomic: Don't fixup modes that haven't been reset
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_atomic_helper.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
|
||||
index 02b4a7dc92f5..f3e59236a8ee 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic_helper.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic_helper.c
|
||||
@@ -438,6 +438,11 @@ mode_fixup(struct drm_atomic_state *state)
|
||||
new_crtc_state =
|
||||
drm_atomic_get_new_crtc_state(state, new_conn_state->crtc);
|
||||
|
||||
+ if (!new_crtc_state->mode_changed &&
|
||||
+ !new_crtc_state->connectors_changed) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Each encoder has at most one connector (since we always steal
|
||||
* it away), so we won't call ->mode_fixup twice.
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
From 93da1ec6ce62d135b38f17004ce32a1681a71483 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:07:30 +0200
|
||||
Subject: [PATCH 006/726] drm/vc4: Fix timings for VEC modes
|
||||
|
||||
This commit fixes vertical timings of the VEC (composite output) modes
|
||||
to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R
|
||||
standards.
|
||||
|
||||
Previous timings were actually defined as 502 and 601 lines, resulting
|
||||
in non-standard 62.69 Hz and 52 Hz signals being generated,
|
||||
respectively.
|
||||
|
||||
Changes to vc4_crtc.c have also been made, to make the PixelValve
|
||||
vertical timings accurately correspond to the DRM modeline in interlaced
|
||||
modes. The resulting VERTA/VERTB register values have been verified
|
||||
against the reference values set by the Raspberry Pi firmware.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 70 +++++++++++++++++++++-------------
|
||||
1 file changed, 43 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 7258975331ca..308b0e1c8af4 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -326,8 +326,14 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
|
||||
bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 ||
|
||||
vc4_encoder->type == VC4_ENCODER_TYPE_DSI1);
|
||||
bool is_dsi1 = vc4_encoder->type == VC4_ENCODER_TYPE_DSI1;
|
||||
+ bool is_vec = vc4_encoder->type == VC4_ENCODER_TYPE_VEC;
|
||||
u32 format = is_dsi1 ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24;
|
||||
u8 ppc = pv_data->pixels_per_clock;
|
||||
+
|
||||
+ u16 vert_bp = mode->crtc_vtotal - mode->crtc_vsync_end;
|
||||
+ u16 vert_sync = mode->crtc_vsync_end - mode->crtc_vsync_start;
|
||||
+ u16 vert_fp = mode->crtc_vsync_start - mode->crtc_vdisplay;
|
||||
+
|
||||
bool debug_dump_regs = false;
|
||||
int idx;
|
||||
|
||||
@@ -355,49 +361,59 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
|
||||
VC4_SET_FIELD(mode->hdisplay * pixel_rep / ppc,
|
||||
PV_HORZB_HACTIVE));
|
||||
|
||||
- CRTC_WRITE(PV_VERTA,
|
||||
- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end +
|
||||
- interlace,
|
||||
- PV_VERTA_VBP) |
|
||||
- VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start,
|
||||
- PV_VERTA_VSYNC));
|
||||
- CRTC_WRITE(PV_VERTB,
|
||||
- VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay,
|
||||
- PV_VERTB_VFP) |
|
||||
- VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE));
|
||||
-
|
||||
if (interlace) {
|
||||
+ bool odd_field_first = false;
|
||||
+ u32 field_delay = mode->htotal * pixel_rep / (2 * ppc);
|
||||
+ u16 vert_bp_even = vert_bp;
|
||||
+ u16 vert_fp_even = vert_fp;
|
||||
+
|
||||
+ if (is_vec) {
|
||||
+ /* VEC (composite output) */
|
||||
+ ++field_delay;
|
||||
+ if (mode->htotal == 858) {
|
||||
+ /* 525-line mode (NTSC or PAL-M) */
|
||||
+ odd_field_first = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (odd_field_first)
|
||||
+ ++vert_fp_even;
|
||||
+ else
|
||||
+ ++vert_bp;
|
||||
+
|
||||
CRTC_WRITE(PV_VERTA_EVEN,
|
||||
- VC4_SET_FIELD(mode->crtc_vtotal -
|
||||
- mode->crtc_vsync_end,
|
||||
- PV_VERTA_VBP) |
|
||||
- VC4_SET_FIELD(mode->crtc_vsync_end -
|
||||
- mode->crtc_vsync_start,
|
||||
- PV_VERTA_VSYNC));
|
||||
+ VC4_SET_FIELD(vert_bp_even, PV_VERTA_VBP) |
|
||||
+ VC4_SET_FIELD(vert_sync, PV_VERTA_VSYNC));
|
||||
CRTC_WRITE(PV_VERTB_EVEN,
|
||||
- VC4_SET_FIELD(mode->crtc_vsync_start -
|
||||
- mode->crtc_vdisplay,
|
||||
- PV_VERTB_VFP) |
|
||||
+ VC4_SET_FIELD(vert_fp_even, PV_VERTB_VFP) |
|
||||
VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE));
|
||||
|
||||
- /* We set up first field even mode for HDMI. VEC's
|
||||
- * NTSC mode would want first field odd instead, once
|
||||
- * we support it (to do so, set ODD_FIRST and put the
|
||||
- * delay in VSYNCD_EVEN instead).
|
||||
+ /* We set up first field even mode for HDMI and VEC's PAL.
|
||||
+ * For NTSC, we need first field odd.
|
||||
*/
|
||||
CRTC_WRITE(PV_V_CONTROL,
|
||||
PV_VCONTROL_CONTINUOUS |
|
||||
(is_dsi ? PV_VCONTROL_DSI : 0) |
|
||||
PV_VCONTROL_INTERLACE |
|
||||
- VC4_SET_FIELD(mode->htotal * pixel_rep / (2 * ppc),
|
||||
- PV_VCONTROL_ODD_DELAY));
|
||||
- CRTC_WRITE(PV_VSYNCD_EVEN, 0);
|
||||
+ (odd_field_first
|
||||
+ ? PV_VCONTROL_ODD_FIRST
|
||||
+ : VC4_SET_FIELD(field_delay,
|
||||
+ PV_VCONTROL_ODD_DELAY)));
|
||||
+ CRTC_WRITE(PV_VSYNCD_EVEN,
|
||||
+ (odd_field_first ? field_delay : 0));
|
||||
} else {
|
||||
CRTC_WRITE(PV_V_CONTROL,
|
||||
PV_VCONTROL_CONTINUOUS |
|
||||
(is_dsi ? PV_VCONTROL_DSI : 0));
|
||||
}
|
||||
|
||||
+ CRTC_WRITE(PV_VERTA,
|
||||
+ VC4_SET_FIELD(vert_bp, PV_VERTA_VBP) |
|
||||
+ VC4_SET_FIELD(vert_sync, PV_VERTA_VSYNC));
|
||||
+ CRTC_WRITE(PV_VERTB,
|
||||
+ VC4_SET_FIELD(vert_fp, PV_VERTB_VFP) |
|
||||
+ VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE));
|
||||
+
|
||||
if (is_dsi)
|
||||
CRTC_WRITE(PV_HACT_ACT, mode->hdisplay * pixel_rep);
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
From 40c3c8aeb177c9a14f60f1225f5e4ecea11ab428 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:07:53 +0200
|
||||
Subject: [PATCH 007/726] drm/vc4: Fix definition of PAL-M mode
|
||||
|
||||
PAL-M is a Brazilian analog TV standard that uses a PAL-style chroma
|
||||
subcarrier at 3.575611[888111] MHz on top of 525-line (480i60) timings.
|
||||
This commit makes the driver actually use the proper VEC preset for this
|
||||
mode instead of just changing PAL subcarrier frequency.
|
||||
|
||||
DRM mode constant names have also been changed, as they no longer
|
||||
correspond to the "NTSC" or "PAL" terms.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index 0b3333865702..de4dec160e72 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -69,6 +69,7 @@
|
||||
#define VEC_CONFIG0_STD_MASK GENMASK(1, 0)
|
||||
#define VEC_CONFIG0_NTSC_STD 0
|
||||
#define VEC_CONFIG0_PAL_BDGHI_STD 1
|
||||
+#define VEC_CONFIG0_PAL_M_STD 2
|
||||
#define VEC_CONFIG0_PAL_N_STD 3
|
||||
|
||||
#define VEC_SCHPH 0x108
|
||||
@@ -224,14 +225,14 @@ static const struct debugfs_reg32 vec_regs[] = {
|
||||
VC4_REG32(VEC_DAC_MISC),
|
||||
};
|
||||
|
||||
-static const struct drm_display_mode ntsc_mode = {
|
||||
+static const struct drm_display_mode drm_mode_480i = {
|
||||
DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0,
|
||||
480, 480 + 7, 480 + 7 + 6, 525, 0,
|
||||
DRM_MODE_FLAG_INTERLACE)
|
||||
};
|
||||
|
||||
-static const struct drm_display_mode pal_mode = {
|
||||
+static const struct drm_display_mode drm_mode_576i = {
|
||||
DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0,
|
||||
576, 576 + 4, 576 + 4 + 6, 625, 0,
|
||||
@@ -240,25 +241,24 @@ static const struct drm_display_mode pal_mode = {
|
||||
|
||||
static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = {
|
||||
[VC4_VEC_TV_MODE_NTSC] = {
|
||||
- .mode = &ntsc_mode,
|
||||
+ .mode = &drm_mode_480i,
|
||||
.config0 = VEC_CONFIG0_NTSC_STD | VEC_CONFIG0_PDEN,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_NTSC_J] = {
|
||||
- .mode = &ntsc_mode,
|
||||
+ .mode = &drm_mode_480i,
|
||||
.config0 = VEC_CONFIG0_NTSC_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL] = {
|
||||
- .mode = &pal_mode,
|
||||
+ .mode = &drm_mode_576i,
|
||||
.config0 = VEC_CONFIG0_PAL_BDGHI_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL_M] = {
|
||||
- .mode = &pal_mode,
|
||||
- .config0 = VEC_CONFIG0_PAL_BDGHI_STD,
|
||||
- .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ,
|
||||
- .custom_freq = 0x223b61d1,
|
||||
+ .mode = &drm_mode_480i,
|
||||
+ .config0 = VEC_CONFIG0_PAL_M_STD,
|
||||
+ .config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
};
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
From 36ae7a7ed4ab799490b541f07c2fc63ad076f01d Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:07:58 +0200
|
||||
Subject: [PATCH 008/726] drm/vc4: Add support for more analog TV standards
|
||||
|
||||
Add support for the following composite output modes (all of them are
|
||||
somewhat more obscure than the previously defined ones):
|
||||
|
||||
- NTSC_443 - NTSC-style signal with the chroma subcarrier shifted to
|
||||
4.43361875 MHz (the PAL subcarrier frequency). Never used for
|
||||
broadcasting, but sometimes used as a hack to play NTSC content in PAL
|
||||
regions (e.g. on VCRs).
|
||||
- PAL_N - PAL with alternative chroma subcarrier frequency,
|
||||
3.58205625 MHz. Used as a broadcast standard in Argentina, Paraguay
|
||||
and Uruguay to fit 576i50 with colour in 6 MHz channel raster.
|
||||
- PAL60 - 480i60 signal with PAL-style color at normal European PAL
|
||||
frequency. Another non-standard, non-broadcast mode, used in similar
|
||||
contexts as NTSC_443. Some displays support one but not the other.
|
||||
- SECAM - French frequency-modulated analog color standard; also have
|
||||
been broadcast in Eastern Europe and various parts of Africa and Asia.
|
||||
Uses the same 576i50 timings as PAL.
|
||||
|
||||
Also added some comments explaining color subcarrier frequency
|
||||
registers.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 63 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 63 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index de4dec160e72..edf73378bfe6 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -46,6 +46,7 @@
|
||||
#define VEC_CONFIG0_YDEL(x) ((x) << 26)
|
||||
#define VEC_CONFIG0_CDEL_MASK GENMASK(25, 24)
|
||||
#define VEC_CONFIG0_CDEL(x) ((x) << 24)
|
||||
+#define VEC_CONFIG0_SECAM_STD BIT(21)
|
||||
#define VEC_CONFIG0_PBPR_FIL BIT(18)
|
||||
#define VEC_CONFIG0_CHROMA_GAIN_MASK GENMASK(17, 16)
|
||||
#define VEC_CONFIG0_CHROMA_GAIN_UNITY (0 << 16)
|
||||
@@ -76,6 +77,27 @@
|
||||
#define VEC_SOFT_RESET 0x10c
|
||||
#define VEC_CLMP0_START 0x144
|
||||
#define VEC_CLMP0_END 0x148
|
||||
+
|
||||
+/*
|
||||
+ * These set the color subcarrier frequency
|
||||
+ * if VEC_CONFIG1_CUSTOM_FREQ is enabled.
|
||||
+ *
|
||||
+ * VEC_FREQ1_0 contains the most significant 16-bit half-word,
|
||||
+ * VEC_FREQ3_2 contains the least significant 16-bit half-word.
|
||||
+ * 0x80000000 seems to be equivalent to the pixel clock
|
||||
+ * (which itself is the VEC clock divided by 8).
|
||||
+ *
|
||||
+ * Reference values (with the default pixel clock of 13.5 MHz):
|
||||
+ *
|
||||
+ * NTSC (3579545.[45] Hz) - 0x21F07C1F
|
||||
+ * PAL (4433618.75 Hz) - 0x2A098ACB
|
||||
+ * PAL-M (3575611.[888111] Hz) - 0x21E6EFE3
|
||||
+ * PAL-N (3582056.25 Hz) - 0x21F69446
|
||||
+ *
|
||||
+ * NOTE: For SECAM, it is used as the Dr center frequency,
|
||||
+ * regardless of whether VEC_CONFIG1_CUSTOM_FREQ is enabled or not;
|
||||
+ * that is specified as 4406250 Hz, which corresponds to 0x29C71C72.
|
||||
+ */
|
||||
#define VEC_FREQ3_2 0x180
|
||||
#define VEC_FREQ1_0 0x184
|
||||
|
||||
@@ -118,6 +140,14 @@
|
||||
|
||||
#define VEC_INTERRUPT_CONTROL 0x190
|
||||
#define VEC_INTERRUPT_STATUS 0x194
|
||||
+
|
||||
+/*
|
||||
+ * Db center frequency for SECAM; the clock for this is the same as for
|
||||
+ * VEC_FREQ3_2/VEC_FREQ1_0, which is used for Dr center frequency.
|
||||
+ *
|
||||
+ * This is specified as 4250000 Hz, which corresponds to 0x284BDA13.
|
||||
+ * That is also the default value, so no need to set it explicitly.
|
||||
+ */
|
||||
#define VEC_FCW_SECAM_B 0x198
|
||||
#define VEC_SECAM_GAIN_VAL 0x19c
|
||||
|
||||
@@ -187,8 +217,12 @@ encoder_to_vc4_vec(struct drm_encoder *encoder)
|
||||
enum vc4_vec_tv_mode_id {
|
||||
VC4_VEC_TV_MODE_NTSC,
|
||||
VC4_VEC_TV_MODE_NTSC_J,
|
||||
+ VC4_VEC_TV_MODE_NTSC_443,
|
||||
VC4_VEC_TV_MODE_PAL,
|
||||
VC4_VEC_TV_MODE_PAL_M,
|
||||
+ VC4_VEC_TV_MODE_PAL_N,
|
||||
+ VC4_VEC_TV_MODE_PAL60,
|
||||
+ VC4_VEC_TV_MODE_SECAM,
|
||||
};
|
||||
|
||||
struct vc4_vec_tv_mode {
|
||||
@@ -250,6 +284,13 @@ static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = {
|
||||
.config0 = VEC_CONFIG0_NTSC_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
+ [VC4_VEC_TV_MODE_NTSC_443] = {
|
||||
+ /* NTSC with PAL chroma frequency */
|
||||
+ .mode = &drm_mode_480i,
|
||||
+ .config0 = VEC_CONFIG0_NTSC_STD,
|
||||
+ .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ,
|
||||
+ .custom_freq = 0x2a098acb,
|
||||
+ },
|
||||
[VC4_VEC_TV_MODE_PAL] = {
|
||||
.mode = &drm_mode_576i,
|
||||
.config0 = VEC_CONFIG0_PAL_BDGHI_STD,
|
||||
@@ -260,6 +301,24 @@ static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = {
|
||||
.config0 = VEC_CONFIG0_PAL_M_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
+ [VC4_VEC_TV_MODE_PAL_N] = {
|
||||
+ .mode = &drm_mode_576i,
|
||||
+ .config0 = VEC_CONFIG0_PAL_N_STD,
|
||||
+ .config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
+ },
|
||||
+ [VC4_VEC_TV_MODE_PAL60] = {
|
||||
+ /* PAL-M with chroma frequency of regular PAL */
|
||||
+ .mode = &drm_mode_480i,
|
||||
+ .config0 = VEC_CONFIG0_PAL_M_STD,
|
||||
+ .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ,
|
||||
+ .custom_freq = 0x2a098acb,
|
||||
+ },
|
||||
+ [VC4_VEC_TV_MODE_SECAM] = {
|
||||
+ .mode = &drm_mode_576i,
|
||||
+ .config0 = VEC_CONFIG0_SECAM_STD,
|
||||
+ .config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
+ .custom_freq = 0x29c71c72,
|
||||
+ },
|
||||
};
|
||||
|
||||
static enum drm_connector_status
|
||||
@@ -503,8 +562,12 @@ static const struct of_device_id vc4_vec_dt_match[] = {
|
||||
static const char * const tv_mode_names[] = {
|
||||
[VC4_VEC_TV_MODE_NTSC] = "NTSC",
|
||||
[VC4_VEC_TV_MODE_NTSC_J] = "NTSC-J",
|
||||
+ [VC4_VEC_TV_MODE_NTSC_443] = "NTSC-443",
|
||||
[VC4_VEC_TV_MODE_PAL] = "PAL",
|
||||
[VC4_VEC_TV_MODE_PAL_M] = "PAL-M",
|
||||
+ [VC4_VEC_TV_MODE_PAL_N] = "PAL-N",
|
||||
+ [VC4_VEC_TV_MODE_PAL60] = "PAL60",
|
||||
+ [VC4_VEC_TV_MODE_SECAM] = "SECAM",
|
||||
};
|
||||
|
||||
static int vc4_vec_bind(struct device *dev, struct device *master, void *data)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
From 745e0786d92efd77c2cbd59be2f94a0997419789 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:08:01 +0200
|
||||
Subject: [PATCH 009/726] drm/vc4: Allow setting the TV norm via module
|
||||
parameter
|
||||
|
||||
Similar to the ch7006 and nouveau drivers, introduce a "tv_mode" module
|
||||
parameter that allow setting the TV norm by specifying vc4.tv_norm= on
|
||||
the kernel command line.
|
||||
|
||||
If that is not specified, try inferring one of the most popular norms
|
||||
(PAL or NTSC) from the video mode specified on the command line. On
|
||||
Raspberry Pis, this causes the most common cases of the sdtv_mode
|
||||
setting in config.txt to be respected.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 72 ++++++++++++++++++++++++++++-------
|
||||
1 file changed, 58 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index edf73378bfe6..369a5e79676b 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -67,7 +67,7 @@
|
||||
#define VEC_CONFIG0_YCDELAY BIT(4)
|
||||
#define VEC_CONFIG0_RAMPEN BIT(2)
|
||||
#define VEC_CONFIG0_YCDIS BIT(2)
|
||||
-#define VEC_CONFIG0_STD_MASK GENMASK(1, 0)
|
||||
+#define VEC_CONFIG0_STD_MASK (VEC_CONFIG0_SECAM_STD | GENMASK(1, 0))
|
||||
#define VEC_CONFIG0_NTSC_STD 0
|
||||
#define VEC_CONFIG0_PAL_BDGHI_STD 1
|
||||
#define VEC_CONFIG0_PAL_M_STD 2
|
||||
@@ -186,6 +186,8 @@
|
||||
#define VEC_DAC_MISC_DAC_RST_N BIT(0)
|
||||
|
||||
|
||||
+static char *vc4_vec_tv_norm;
|
||||
+
|
||||
struct vc4_vec_variant {
|
||||
u32 dac_config;
|
||||
};
|
||||
@@ -321,6 +323,44 @@ static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = {
|
||||
},
|
||||
};
|
||||
|
||||
+static const char * const tv_mode_names[] = {
|
||||
+ [VC4_VEC_TV_MODE_NTSC] = "NTSC",
|
||||
+ [VC4_VEC_TV_MODE_NTSC_J] = "NTSC-J",
|
||||
+ [VC4_VEC_TV_MODE_NTSC_443] = "NTSC-443",
|
||||
+ [VC4_VEC_TV_MODE_PAL] = "PAL",
|
||||
+ [VC4_VEC_TV_MODE_PAL_M] = "PAL-M",
|
||||
+ [VC4_VEC_TV_MODE_PAL_N] = "PAL-N",
|
||||
+ [VC4_VEC_TV_MODE_PAL60] = "PAL60",
|
||||
+ [VC4_VEC_TV_MODE_SECAM] = "SECAM",
|
||||
+};
|
||||
+
|
||||
+enum vc4_vec_tv_mode_id
|
||||
+vc4_vec_get_default_mode(struct drm_connector *connector)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ if (vc4_vec_tv_norm) {
|
||||
+ for (i = 0; i < ARRAY_SIZE(tv_mode_names); i++)
|
||||
+ if (strcmp(vc4_vec_tv_norm, tv_mode_names[i]) == 0)
|
||||
+ return (enum vc4_vec_tv_mode_id) i;
|
||||
+ } else if (connector->cmdline_mode.specified &&
|
||||
+ ((connector->cmdline_mode.refresh_specified &&
|
||||
+ (connector->cmdline_mode.refresh == 25 ||
|
||||
+ connector->cmdline_mode.refresh == 50)) ||
|
||||
+ (!connector->cmdline_mode.refresh_specified &&
|
||||
+ (connector->cmdline_mode.yres == 288 ||
|
||||
+ connector->cmdline_mode.yres == 576)))) {
|
||||
+ /*
|
||||
+ * no explicitly specified TV norm; use PAL if a mode that
|
||||
+ * looks like PAL has been specified on the command line
|
||||
+ */
|
||||
+ return VC4_VEC_TV_MODE_PAL;
|
||||
+ }
|
||||
+
|
||||
+ /* in all other cases, default to NTSC */
|
||||
+ return VC4_VEC_TV_MODE_NTSC;
|
||||
+}
|
||||
+
|
||||
static enum drm_connector_status
|
||||
vc4_vec_connector_detect(struct drm_connector *connector, bool force)
|
||||
{
|
||||
@@ -344,10 +384,18 @@ static int vc4_vec_connector_get_modes(struct drm_connector *connector)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static void vc4_vec_connector_reset(struct drm_connector *connector)
|
||||
+{
|
||||
+ drm_atomic_helper_connector_reset(connector);
|
||||
+ /* preserve TV standard */
|
||||
+ if (connector->state)
|
||||
+ connector->state->tv.mode = vc4_vec_get_default_mode(connector);
|
||||
+}
|
||||
+
|
||||
static const struct drm_connector_funcs vc4_vec_connector_funcs = {
|
||||
.detect = vc4_vec_connector_detect,
|
||||
.fill_modes = drm_helper_probe_single_connector_modes,
|
||||
- .reset = drm_atomic_helper_connector_reset,
|
||||
+ .reset = vc4_vec_connector_reset,
|
||||
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
|
||||
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
||||
};
|
||||
@@ -372,7 +420,7 @@ static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec)
|
||||
|
||||
drm_object_attach_property(&connector->base,
|
||||
dev->mode_config.tv_mode_property,
|
||||
- VC4_VEC_TV_MODE_NTSC);
|
||||
+ vc4_vec_get_default_mode(connector));
|
||||
|
||||
drm_connector_attach_encoder(connector, &vec->encoder.base);
|
||||
|
||||
@@ -559,17 +607,6 @@ static const struct of_device_id vc4_vec_dt_match[] = {
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
-static const char * const tv_mode_names[] = {
|
||||
- [VC4_VEC_TV_MODE_NTSC] = "NTSC",
|
||||
- [VC4_VEC_TV_MODE_NTSC_J] = "NTSC-J",
|
||||
- [VC4_VEC_TV_MODE_NTSC_443] = "NTSC-443",
|
||||
- [VC4_VEC_TV_MODE_PAL] = "PAL",
|
||||
- [VC4_VEC_TV_MODE_PAL_M] = "PAL-M",
|
||||
- [VC4_VEC_TV_MODE_PAL_N] = "PAL-N",
|
||||
- [VC4_VEC_TV_MODE_PAL60] = "PAL60",
|
||||
- [VC4_VEC_TV_MODE_SECAM] = "SECAM",
|
||||
-};
|
||||
-
|
||||
static int vc4_vec_bind(struct device *dev, struct device *master, void *data)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
@@ -650,3 +687,10 @@ struct platform_driver vc4_vec_driver = {
|
||||
.of_match_table = vc4_vec_dt_match,
|
||||
},
|
||||
};
|
||||
+
|
||||
+module_param_named(tv_norm, vc4_vec_tv_norm, charp, 0600);
|
||||
+MODULE_PARM_DESC(tv_norm, "Default TV norm.\n"
|
||||
+ "\t\tSupported: NTSC, NTSC-J, NTSC-443, PAL, PAL-M, PAL-N,\n"
|
||||
+ "\t\t\tPAL60, SECAM.\n"
|
||||
+ "\t\tDefault: PAL if a 50 Hz mode has been set via video=,\n"
|
||||
+ "\t\t\tNTSC otherwise");
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
From b6a1bf7813c09fdee464de84eba7d3de0d5b73a5 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:08:05 +0200
|
||||
Subject: [PATCH 010/726] drm/vc4: Refactor mode checking logic
|
||||
|
||||
Replace drm_encoder_helper_funcs::atomic_check with
|
||||
drm_connector_helper_funcs::atomic_check - the former is not called
|
||||
during drm_mode_obj_set_property_ioctl(). Set crtc_state->mode_changed
|
||||
if TV norm changes even without explicit mode change. This makes things
|
||||
like "xrandr --output Composite-1 --set mode PAL-M" work properly.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 42 ++++++++++++++++++++++-------------
|
||||
1 file changed, 26 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index 369a5e79676b..c613f930f079 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -392,6 +392,31 @@ static void vc4_vec_connector_reset(struct drm_connector *connector)
|
||||
connector->state->tv.mode = vc4_vec_get_default_mode(connector);
|
||||
}
|
||||
|
||||
+static int vc4_vec_connector_atomic_check(struct drm_connector *conn,
|
||||
+ struct drm_atomic_state *state)
|
||||
+{
|
||||
+ struct drm_connector_state *old_state =
|
||||
+ drm_atomic_get_old_connector_state(state, conn);
|
||||
+ struct drm_connector_state *new_state =
|
||||
+ drm_atomic_get_new_connector_state(state, conn);
|
||||
+
|
||||
+ const struct vc4_vec_tv_mode *vec_mode =
|
||||
+ &vc4_vec_tv_modes[new_state->tv.mode];
|
||||
+
|
||||
+ if (new_state->crtc) {
|
||||
+ struct drm_crtc_state *crtc_state =
|
||||
+ drm_atomic_get_new_crtc_state(state, new_state->crtc);
|
||||
+
|
||||
+ if (!drm_mode_equal(vec_mode->mode, &crtc_state->mode))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (old_state->tv.mode != new_state->tv.mode)
|
||||
+ crtc_state->mode_changed = true;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const struct drm_connector_funcs vc4_vec_connector_funcs = {
|
||||
.detect = vc4_vec_connector_detect,
|
||||
.fill_modes = drm_helper_probe_single_connector_modes,
|
||||
@@ -402,6 +427,7 @@ static const struct drm_connector_funcs vc4_vec_connector_funcs = {
|
||||
|
||||
static const struct drm_connector_helper_funcs vc4_vec_connector_helper_funcs = {
|
||||
.get_modes = vc4_vec_connector_get_modes,
|
||||
+ .atomic_check = vc4_vec_connector_atomic_check,
|
||||
};
|
||||
|
||||
static int vc4_vec_connector_init(struct drm_device *dev, struct vc4_vec *vec)
|
||||
@@ -550,23 +576,7 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
|
||||
drm_dev_exit(idx);
|
||||
}
|
||||
|
||||
-static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder,
|
||||
- struct drm_crtc_state *crtc_state,
|
||||
- struct drm_connector_state *conn_state)
|
||||
-{
|
||||
- const struct vc4_vec_tv_mode *vec_mode;
|
||||
-
|
||||
- vec_mode = &vc4_vec_tv_modes[conn_state->tv.mode];
|
||||
-
|
||||
- if (conn_state->crtc &&
|
||||
- !drm_mode_equal(vec_mode->mode, &crtc_state->adjusted_mode))
|
||||
- return -EINVAL;
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = {
|
||||
- .atomic_check = vc4_vec_encoder_atomic_check,
|
||||
.atomic_disable = vc4_vec_encoder_disable,
|
||||
.atomic_enable = vc4_vec_encoder_enable,
|
||||
};
|
||||
--
|
||||
2.33.1
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,287 +0,0 @@
|
|||
From 428fd818d7c1b943c486cfdf163a71f33a8ec9ce Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 27 Apr 2021 14:24:21 +0200
|
||||
Subject: [PATCH 012/726] drm/vc4: Add support for gamma on BCM2711
|
||||
|
||||
BCM2711 changes from a 256 entry lookup table to a 16 point
|
||||
piecewise linear function as the pipeline bitdepth has increased
|
||||
to make a LUT unwieldy.
|
||||
|
||||
Implement a simple conversion from a 256 entry LUT that userspace
|
||||
is likely to expect to 16 evenly spread points in the PWL. This
|
||||
could be improved with curve fitting at a later date.
|
||||
|
||||
Co-developed-by: Juerg Haefliger <juergh@canonical.com>
|
||||
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 35 ++++++++++---
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 28 +++++++++--
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 89 ++++++++++++++++++++++++++++++++--
|
||||
drivers/gpu/drm/vc4/vc4_regs.h | 22 +++++++++
|
||||
4 files changed, 162 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 308b0e1c8af4..1e22d13768a0 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -1326,19 +1326,42 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc,
|
||||
|
||||
if (!vc4->is_vc5) {
|
||||
drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
|
||||
+ } else {
|
||||
+ /* This is a lie for hvs5 which uses a 16 point PWL, but it
|
||||
+ * allows for something smarter than just 16 linearly spaced
|
||||
+ * segments. Conversion is done in vc5_hvs_update_gamma_lut.
|
||||
+ */
|
||||
+ drm_mode_crtc_set_gamma_size(crtc, 256);
|
||||
+ }
|
||||
|
||||
- drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
|
||||
+ drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
|
||||
|
||||
+ if (!vc4->is_vc5) {
|
||||
/* We support CTM, but only for one CRTC at a time. It's therefore
|
||||
* implemented as private driver state in vc4_kms, not here.
|
||||
*/
|
||||
drm_crtc_enable_color_mgmt(crtc, 0, true, crtc->gamma_size);
|
||||
- }
|
||||
|
||||
- for (i = 0; i < crtc->gamma_size; i++) {
|
||||
- vc4_crtc->lut_r[i] = i;
|
||||
- vc4_crtc->lut_g[i] = i;
|
||||
- vc4_crtc->lut_b[i] = i;
|
||||
+ /* Initialize the VC4 gamma LUTs */
|
||||
+ for (i = 0; i < crtc->gamma_size; i++) {
|
||||
+ vc4_crtc->lut_r[i] = i;
|
||||
+ vc4_crtc->lut_g[i] = i;
|
||||
+ vc4_crtc->lut_b[i] = i;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* Initialize the VC5 gamma PWL entries. Assume 12-bit pipeline,
|
||||
+ * evenly spread over full range.
|
||||
+ */
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++) {
|
||||
+ vc4_crtc->pwl_r[i] =
|
||||
+ VC5_HVS_SET_GAMMA_ENTRY(i << 8, i << 12, 1 << 8);
|
||||
+ vc4_crtc->pwl_g[i] =
|
||||
+ VC5_HVS_SET_GAMMA_ENTRY(i << 8, i << 12, 1 << 8);
|
||||
+ vc4_crtc->pwl_b[i] =
|
||||
+ VC5_HVS_SET_GAMMA_ENTRY(i << 8, i << 12, 1 << 8);
|
||||
+ vc4_crtc->pwl_a[i] =
|
||||
+ VC5_HVS_SET_GAMMA_ENTRY(i << 8, i << 12, 1 << 8);
|
||||
+ }
|
||||
}
|
||||
|
||||
return 0;
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
index 7da22fe3a6cc..71a07c838c35 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <drm/drm_modeset_lock.h>
|
||||
|
||||
#include "uapi/drm/vc4_drm.h"
|
||||
+#include "vc4_regs.h"
|
||||
|
||||
struct drm_device;
|
||||
struct drm_gem_object;
|
||||
@@ -481,6 +482,17 @@ struct vc4_pv_data {
|
||||
enum vc4_encoder_type encoder_types[4];
|
||||
};
|
||||
|
||||
+struct vc5_gamma_entry {
|
||||
+ u32 x_c_terms;
|
||||
+ u32 grad_term;
|
||||
+};
|
||||
+
|
||||
+#define VC5_HVS_SET_GAMMA_ENTRY(x, c, g) (struct vc5_gamma_entry){ \
|
||||
+ .x_c_terms = VC4_SET_FIELD((x), SCALER5_DSPGAMMA_OFF_X) | \
|
||||
+ VC4_SET_FIELD((c), SCALER5_DSPGAMMA_OFF_C), \
|
||||
+ .grad_term = (g) \
|
||||
+}
|
||||
+
|
||||
struct vc4_crtc {
|
||||
struct drm_crtc base;
|
||||
struct platform_device *pdev;
|
||||
@@ -490,9 +502,19 @@ struct vc4_crtc {
|
||||
/* Timestamp at start of vblank irq - unaffected by lock delays. */
|
||||
ktime_t t_vblank;
|
||||
|
||||
- u8 lut_r[256];
|
||||
- u8 lut_g[256];
|
||||
- u8 lut_b[256];
|
||||
+ union {
|
||||
+ struct { /* VC4 gamma LUT */
|
||||
+ u8 lut_r[256];
|
||||
+ u8 lut_g[256];
|
||||
+ u8 lut_b[256];
|
||||
+ };
|
||||
+ struct { /* VC5 gamma PWL entries */
|
||||
+ struct vc5_gamma_entry pwl_r[SCALER5_DSPGAMMA_NUM_POINTS];
|
||||
+ struct vc5_gamma_entry pwl_g[SCALER5_DSPGAMMA_NUM_POINTS];
|
||||
+ struct vc5_gamma_entry pwl_b[SCALER5_DSPGAMMA_NUM_POINTS];
|
||||
+ struct vc5_gamma_entry pwl_a[SCALER5_DSPGAMMA_NUM_POINTS];
|
||||
+ };
|
||||
+ };
|
||||
|
||||
struct drm_pending_vblank_event *event;
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 47990ecbfc4d..303f1341db46 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -241,7 +241,8 @@ static void vc4_hvs_lut_load(struct vc4_hvs *hvs,
|
||||
static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs,
|
||||
struct vc4_crtc *vc4_crtc)
|
||||
{
|
||||
- struct drm_crtc_state *crtc_state = vc4_crtc->base.state;
|
||||
+ struct drm_crtc *crtc = &vc4_crtc->base;
|
||||
+ struct drm_crtc_state *crtc_state = crtc->state;
|
||||
struct drm_color_lut *lut = crtc_state->gamma_lut->data;
|
||||
u32 length = drm_color_lut_size(crtc_state->gamma_lut);
|
||||
u32 i;
|
||||
@@ -255,6 +256,81 @@ static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs,
|
||||
vc4_hvs_lut_load(hvs, vc4_crtc);
|
||||
}
|
||||
|
||||
+static void vc5_hvs_write_gamma_entry(struct vc4_hvs *hvs,
|
||||
+ u32 offset,
|
||||
+ struct vc5_gamma_entry *gamma)
|
||||
+{
|
||||
+ HVS_WRITE(offset, gamma->x_c_terms);
|
||||
+ HVS_WRITE(offset + 4, gamma->grad_term);
|
||||
+}
|
||||
+
|
||||
+static void vc5_hvs_lut_load(struct vc4_hvs *hvs,
|
||||
+ struct vc4_crtc *vc4_crtc)
|
||||
+{
|
||||
+ struct drm_crtc *crtc = &vc4_crtc->base;
|
||||
+ struct drm_crtc_state *crtc_state = crtc->state;
|
||||
+ struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state);
|
||||
+ u32 i;
|
||||
+ u32 offset = SCALER5_DSPGAMMA_START +
|
||||
+ vc4_state->assigned_channel * SCALER5_DSPGAMMA_CHAN_OFFSET;
|
||||
+
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8)
|
||||
+ vc5_hvs_write_gamma_entry(hvs, offset, &vc4_crtc->pwl_r[i]);
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8)
|
||||
+ vc5_hvs_write_gamma_entry(hvs, offset, &vc4_crtc->pwl_g[i]);
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8)
|
||||
+ vc5_hvs_write_gamma_entry(hvs, offset, &vc4_crtc->pwl_b[i]);
|
||||
+
|
||||
+ if (vc4_state->assigned_channel == 2) {
|
||||
+ /* Alpha only valid on channel 2 */
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8)
|
||||
+ vc5_hvs_write_gamma_entry(hvs, offset, &vc4_crtc->pwl_a[i]);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void vc5_hvs_update_gamma_lut(struct vc4_hvs *hvs,
|
||||
+ struct vc4_crtc *vc4_crtc)
|
||||
+{
|
||||
+ struct drm_crtc *crtc = &vc4_crtc->base;
|
||||
+ struct drm_color_lut *lut = crtc->state->gamma_lut->data;
|
||||
+ unsigned int step, i;
|
||||
+ u32 start, end;
|
||||
+
|
||||
+#define VC5_HVS_UPDATE_GAMMA_ENTRY_FROM_LUT(pwl, chan) \
|
||||
+ start = drm_color_lut_extract(lut[i * step].chan, 12); \
|
||||
+ end = drm_color_lut_extract(lut[(i + 1) * step - 1].chan, 12); \
|
||||
+ \
|
||||
+ /* Negative gradients not permitted by the hardware, so \
|
||||
+ * flatten such points out. \
|
||||
+ */ \
|
||||
+ if (end < start) \
|
||||
+ end = start; \
|
||||
+ \
|
||||
+ /* Assume 12bit pipeline. \
|
||||
+ * X evenly spread over full range (12 bit). \
|
||||
+ * C as U12.4 format. \
|
||||
+ * Gradient as U4.8 format. \
|
||||
+ */ \
|
||||
+ vc4_crtc->pwl[i] = \
|
||||
+ VC5_HVS_SET_GAMMA_ENTRY(i << 8, start << 4, \
|
||||
+ ((end - start) << 4) / (step - 1))
|
||||
+
|
||||
+ /* HVS5 has a 16 point piecewise linear function for each colour
|
||||
+ * channel (including alpha on channel 2) on each display channel.
|
||||
+ *
|
||||
+ * Currently take a crude subsample of the gamma LUT, but this could
|
||||
+ * be improved to implement curve fitting.
|
||||
+ */
|
||||
+ step = crtc->gamma_size / SCALER5_DSPGAMMA_NUM_POINTS;
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++) {
|
||||
+ VC5_HVS_UPDATE_GAMMA_ENTRY_FROM_LUT(pwl_r, red);
|
||||
+ VC5_HVS_UPDATE_GAMMA_ENTRY_FROM_LUT(pwl_g, green);
|
||||
+ VC5_HVS_UPDATE_GAMMA_ENTRY_FROM_LUT(pwl_b, blue);
|
||||
+ }
|
||||
+
|
||||
+ vc5_hvs_lut_load(hvs, vc4_crtc);
|
||||
+}
|
||||
+
|
||||
u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo)
|
||||
{
|
||||
struct drm_device *drm = &hvs->vc4->base;
|
||||
@@ -398,7 +474,10 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
|
||||
/* Reload the LUT, since the SRAMs would have been disabled if
|
||||
* all CRTCs had SCALER_DISPBKGND_GAMMA unset at once.
|
||||
*/
|
||||
- vc4_hvs_lut_load(hvs, vc4_crtc);
|
||||
+ if (!vc4->is_vc5)
|
||||
+ vc4_hvs_lut_load(hvs, vc4_crtc);
|
||||
+ else
|
||||
+ vc5_hvs_lut_load(hvs, vc4_crtc);
|
||||
|
||||
drm_dev_exit(idx);
|
||||
|
||||
@@ -628,7 +707,11 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
|
||||
u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel));
|
||||
|
||||
if (crtc->state->gamma_lut) {
|
||||
- vc4_hvs_update_gamma_lut(hvs, vc4_crtc);
|
||||
+ if (!vc4->is_vc5)
|
||||
+ vc4_hvs_update_gamma_lut(hvs, vc4_crtc);
|
||||
+ else
|
||||
+ vc5_hvs_update_gamma_lut(hvs, vc4_crtc);
|
||||
+
|
||||
dispbkgndx |= SCALER_DISPBKGND_GAMMA;
|
||||
} else {
|
||||
/* Unsetting DISPBKGND_GAMMA skips the gamma lut step
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
index 1256f0877ff6..e162d3f3bd3c 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
@@ -512,6 +512,28 @@
|
||||
#define SCALER_DLIST_START 0x00002000
|
||||
#define SCALER_DLIST_SIZE 0x00004000
|
||||
|
||||
+/* Gamma PWL for each channel. 16 points for each of 4 colour channels (alpha
|
||||
+ * only on channel 2). 8 bytes per entry, offsets first, then gradient:
|
||||
+ * Y = GRAD * X + C
|
||||
+ *
|
||||
+ * Values for X and C are left justified, and vary depending on the width of
|
||||
+ * the HVS channel:
|
||||
+ * 8-bit pipeline: X uses [31:24], C is U8.8 format, and GRAD is U4.8.
|
||||
+ * 12-bit pipeline: X uses [31:20], C is U12.4 format, and GRAD is U4.8.
|
||||
+ *
|
||||
+ * The 3 HVS channels start at 0x400 offsets (ie chan 1 starts at 0x2400, and
|
||||
+ * chan 2 at 0x2800).
|
||||
+ */
|
||||
+#define SCALER5_DSPGAMMA_NUM_POINTS 16
|
||||
+#define SCALER5_DSPGAMMA_START 0x00002000
|
||||
+#define SCALER5_DSPGAMMA_CHAN_OFFSET 0x400
|
||||
+# define SCALER5_DSPGAMMA_OFF_X_MASK VC4_MASK(31, 20)
|
||||
+# define SCALER5_DSPGAMMA_OFF_X_SHIFT 20
|
||||
+# define SCALER5_DSPGAMMA_OFF_C_MASK VC4_MASK(15, 0)
|
||||
+# define SCALER5_DSPGAMMA_OFF_C_SHIFT 0
|
||||
+# define SCALER5_DSPGAMMA_GRAD_MASK VC4_MASK(11, 0)
|
||||
+# define SCALER5_DSPGAMMA_GRAD_SHIFT 0
|
||||
+
|
||||
#define SCALER5_DLIST_START 0x00004000
|
||||
|
||||
# define VC4_HDMI_SW_RESET_FORMAT_DETECT BIT(1)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
From b2031f4311ac4cee4a089e6a919f2703c4e36887 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 28 Apr 2021 12:32:10 +0200
|
||||
Subject: [PATCH 013/726] drm/vc4: Add debugfs node that dumps the vc5 gamma
|
||||
PWL entries
|
||||
|
||||
This helps with debugging the conversion from a 256 point gamma LUT to
|
||||
16 point PWL entries as used by the BCM2711.
|
||||
|
||||
Co-developed-by: Juerg Haefliger <juergh@canonical.com>
|
||||
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 85 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 84 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 303f1341db46..5374502bce37 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -141,6 +141,85 @@ static int vc4_hvs_debugfs_dlist(struct seq_file *m, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int vc5_hvs_debugfs_gamma(struct seq_file *m, void *data)
|
||||
+{
|
||||
+ struct drm_info_node *node = m->private;
|
||||
+ struct drm_device *dev = node->minor->dev;
|
||||
+ struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
+ struct vc4_hvs *hvs = vc4->hvs;
|
||||
+ struct drm_printer p = drm_seq_file_printer(m);
|
||||
+ unsigned int i, chan;
|
||||
+ u32 dispstat, dispbkgndx;
|
||||
+
|
||||
+ for (chan = 0; chan < SCALER_CHANNELS_COUNT; chan++) {
|
||||
+ u32 x_c, grad;
|
||||
+ u32 offset = SCALER5_DSPGAMMA_START +
|
||||
+ chan * SCALER5_DSPGAMMA_CHAN_OFFSET;
|
||||
+
|
||||
+ dispstat = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTATX(chan)),
|
||||
+ SCALER_DISPSTATX_MODE);
|
||||
+ if (dispstat == SCALER_DISPSTATX_MODE_DISABLED ||
|
||||
+ dispstat == SCALER_DISPSTATX_MODE_EOF) {
|
||||
+ drm_printf(&p, "HVS channel %u: Channel disabled\n", chan);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(chan));
|
||||
+ if (!(dispbkgndx & SCALER_DISPBKGND_GAMMA)) {
|
||||
+ drm_printf(&p, "HVS channel %u: Gamma disabled\n", chan);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ drm_printf(&p, "HVS channel %u:\n", chan);
|
||||
+ drm_printf(&p, " red:\n");
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8) {
|
||||
+ x_c = HVS_READ(offset);
|
||||
+ grad = HVS_READ(offset + 4);
|
||||
+ drm_printf(&p, " %08x %08x - x %u, c %u, grad %u\n",
|
||||
+ x_c, grad,
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_X),
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_C),
|
||||
+ grad);
|
||||
+ }
|
||||
+ drm_printf(&p, " green:\n");
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8) {
|
||||
+ x_c = HVS_READ(offset);
|
||||
+ grad = HVS_READ(offset + 4);
|
||||
+ drm_printf(&p, " %08x %08x - x %u, c %u, grad %u\n",
|
||||
+ x_c, grad,
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_X),
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_C),
|
||||
+ grad);
|
||||
+ }
|
||||
+ drm_printf(&p, " blue:\n");
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8) {
|
||||
+ x_c = HVS_READ(offset);
|
||||
+ grad = HVS_READ(offset + 4);
|
||||
+ drm_printf(&p, " %08x %08x - x %u, c %u, grad %u\n",
|
||||
+ x_c, grad,
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_X),
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_C),
|
||||
+ grad);
|
||||
+ }
|
||||
+
|
||||
+ /* Alpha only valid on channel 2 */
|
||||
+ if (chan != 2)
|
||||
+ continue;
|
||||
+
|
||||
+ drm_printf(&p, " alpha:\n");
|
||||
+ for (i = 0; i < SCALER5_DSPGAMMA_NUM_POINTS; i++, offset += 8) {
|
||||
+ x_c = HVS_READ(offset);
|
||||
+ grad = HVS_READ(offset + 4);
|
||||
+ drm_printf(&p, " %08x %08x - x %u, c %u, grad %u\n",
|
||||
+ x_c, grad,
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_X),
|
||||
+ VC4_GET_FIELD(x_c, SCALER5_DSPGAMMA_OFF_C),
|
||||
+ grad);
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* The filter kernel is composed of dwords each containing 3 9-bit
|
||||
* signed integers packed next to each other.
|
||||
*/
|
||||
@@ -833,11 +912,15 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
|
||||
if (!vc4->hvs)
|
||||
return -ENODEV;
|
||||
|
||||
- if (!vc4->is_vc5)
|
||||
+ if (!vc4->is_vc5) {
|
||||
debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR,
|
||||
minor->debugfs_root,
|
||||
&vc4->load_tracker_enabled);
|
||||
|
||||
+ vc4_debugfs_add_file(minor, "hvs_gamma", vc5_hvs_debugfs_gamma,
|
||||
+ NULL);
|
||||
+ }
|
||||
+
|
||||
ret = vc4_debugfs_add_file(minor, "hvs_dlists",
|
||||
vc4_hvs_debugfs_dlist, NULL);
|
||||
if (ret)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
From c6186375d4b403bc6b078e317ef65e196dc38ce8 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 14 Jun 2021 15:28:30 +0200
|
||||
Subject: [PATCH 014/726] drm/vc4: hvs: Force modeset on gamma lut change
|
||||
|
||||
The HVS Gamma block can only be updated when idle, so we need to disable
|
||||
the HVS channel when the gamma property is set in an atomic commit.
|
||||
|
||||
Since the pixelvalve cannot have its assigned channel halted without
|
||||
stalling unless it's disabled as well, in our case that means forcing a
|
||||
full disable / enable cycle on the pipeline.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++++++++
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 3 +++
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 32 +++++++++++++++++++++++++++++++-
|
||||
3 files changed, 51 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 1e22d13768a0..187508545053 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -293,6 +293,23 @@ struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+#define drm_for_each_connector_mask(connector, dev, connector_mask) \
|
||||
+ list_for_each_entry((connector), &(dev)->mode_config.connector_list, head) \
|
||||
+ for_each_if ((connector_mask) & drm_connector_mask(connector))
|
||||
+
|
||||
+struct drm_connector *vc4_get_crtc_connector(struct drm_crtc *crtc,
|
||||
+ struct drm_crtc_state *state)
|
||||
+{
|
||||
+ struct drm_connector *connector;
|
||||
+
|
||||
+ WARN_ON(hweight32(state->connector_mask) > 1);
|
||||
+
|
||||
+ drm_for_each_connector_mask(connector, crtc->dev, state->connector_mask)
|
||||
+ return connector;
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
static void vc4_crtc_pixelvalve_reset(struct drm_crtc *crtc)
|
||||
{
|
||||
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
index 71a07c838c35..d54182f995ef 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -568,6 +568,9 @@ vc4_crtc_to_vc4_pv_data(const struct vc4_crtc *crtc)
|
||||
return container_of(data, struct vc4_pv_data, base);
|
||||
}
|
||||
|
||||
+struct drm_connector *vc4_get_crtc_connector(struct drm_crtc *crtc,
|
||||
+ struct drm_crtc_state *state);
|
||||
+
|
||||
struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *state);
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 5374502bce37..950d719a126b 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -594,6 +594,36 @@ void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan)
|
||||
drm_dev_exit(idx);
|
||||
}
|
||||
|
||||
+static int vc4_hvs_gamma_check(struct drm_crtc *crtc,
|
||||
+ struct drm_atomic_state *state)
|
||||
+{
|
||||
+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
|
||||
+ struct drm_connector_state *conn_state;
|
||||
+ struct drm_connector *connector;
|
||||
+ struct drm_device *dev = crtc->dev;
|
||||
+ struct vc4_dev *vc4 = to_vc4_dev(dev);
|
||||
+
|
||||
+ if (!vc4->is_vc5)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!crtc_state->color_mgmt_changed)
|
||||
+ return 0;
|
||||
+
|
||||
+ connector = vc4_get_crtc_connector(crtc, crtc_state);
|
||||
+ if (!connector)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (!(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA))
|
||||
+ return 0;
|
||||
+
|
||||
+ conn_state = drm_atomic_get_connector_state(state, connector);
|
||||
+ if (!conn_state)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ crtc_state->mode_changed = true;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
|
||||
{
|
||||
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
|
||||
@@ -624,7 +654,7 @@ int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- return 0;
|
||||
+ return vc4_hvs_gamma_check(crtc, state);
|
||||
}
|
||||
|
||||
static void vc4_hvs_install_dlist(struct drm_crtc *crtc)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,156 +0,0 @@
|
|||
From 3a5fd02c008823944e30940d6747a2d4e21c8b7e Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:08:08 +0200
|
||||
Subject: [PATCH 015/726] drm/vc4: Relax VEC modeline requirements and add
|
||||
progressive mode support
|
||||
|
||||
Make vc4_vec_encoder_atomic_check() accept arbitrary modelines, as long
|
||||
as they result in somewhat sane output from the VEC. The bounds have
|
||||
been determined empirically. Additionally, add support for the
|
||||
progressive 262-line and 312-line modes.
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 1 +
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 94 ++++++++++++++++++++++++++++++----
|
||||
2 files changed, 85 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 187508545053..fc4e2e658e6d 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -422,6 +422,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
|
||||
CRTC_WRITE(PV_V_CONTROL,
|
||||
PV_VCONTROL_CONTINUOUS |
|
||||
(is_dsi ? PV_VCONTROL_DSI : 0));
|
||||
+ CRTC_WRITE(PV_VSYNCD_EVEN, 0);
|
||||
}
|
||||
|
||||
CRTC_WRITE(PV_VERTA,
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index c613f930f079..e32a7b45b2b9 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -400,18 +400,11 @@ static int vc4_vec_connector_atomic_check(struct drm_connector *conn,
|
||||
struct drm_connector_state *new_state =
|
||||
drm_atomic_get_new_connector_state(state, conn);
|
||||
|
||||
- const struct vc4_vec_tv_mode *vec_mode =
|
||||
- &vc4_vec_tv_modes[new_state->tv.mode];
|
||||
-
|
||||
- if (new_state->crtc) {
|
||||
+ if (new_state->crtc && old_state->tv.mode != new_state->tv.mode) {
|
||||
struct drm_crtc_state *crtc_state =
|
||||
drm_atomic_get_new_crtc_state(state, new_state->crtc);
|
||||
|
||||
- if (!drm_mode_equal(vec_mode->mode, &crtc_state->mode))
|
||||
- return -EINVAL;
|
||||
-
|
||||
- if (old_state->tv.mode != new_state->tv.mode)
|
||||
- crtc_state->mode_changed = true;
|
||||
+ crtc_state->mode_changed = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -546,7 +539,10 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
|
||||
VEC_WRITE(VEC_CLMP0_START, 0xac);
|
||||
VEC_WRITE(VEC_CLMP0_END, 0xec);
|
||||
VEC_WRITE(VEC_CONFIG2,
|
||||
- VEC_CONFIG2_UV_DIG_DIS | VEC_CONFIG2_RGB_DIG_DIS);
|
||||
+ VEC_CONFIG2_UV_DIG_DIS |
|
||||
+ VEC_CONFIG2_RGB_DIG_DIS |
|
||||
+ ((encoder->crtc->state->adjusted_mode.flags &
|
||||
+ DRM_MODE_FLAG_INTERLACE) ? 0 : VEC_CONFIG2_PROG_SCAN));
|
||||
VEC_WRITE(VEC_CONFIG3, VEC_CONFIG3_HORIZ_LEN_STD);
|
||||
VEC_WRITE(VEC_DAC_CONFIG, vec->variant->dac_config);
|
||||
|
||||
@@ -575,8 +571,86 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder,
|
||||
err_dev_exit:
|
||||
drm_dev_exit(idx);
|
||||
}
|
||||
+static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder,
|
||||
+ struct drm_crtc_state *crtc_state,
|
||||
+ struct drm_connector_state *conn_state)
|
||||
+{
|
||||
+ const struct drm_display_mode *reference_mode =
|
||||
+ vc4_vec_tv_modes[conn_state->tv.mode].mode;
|
||||
+
|
||||
+ if (crtc_state->adjusted_mode.crtc_clock != reference_mode->clock ||
|
||||
+ crtc_state->adjusted_mode.crtc_htotal != reference_mode->htotal ||
|
||||
+ crtc_state->adjusted_mode.crtc_hdisplay % 4 != 0 ||
|
||||
+ crtc_state->adjusted_mode.crtc_hsync_end -
|
||||
+ crtc_state->adjusted_mode.crtc_hsync_start < 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ switch (reference_mode->vtotal) {
|
||||
+ case 525:
|
||||
+ if (crtc_state->adjusted_mode.crtc_vdisplay < 1 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vdisplay > 253 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_start -
|
||||
+ crtc_state->adjusted_mode.crtc_vdisplay < 1 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_end -
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_start != 3 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal -
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_end < 4 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal > 262)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if ((crtc_state->adjusted_mode.flags &
|
||||
+ DRM_MODE_FLAG_INTERLACE) &&
|
||||
+ (crtc_state->adjusted_mode.vdisplay % 2 != 0 ||
|
||||
+ crtc_state->adjusted_mode.vsync_start % 2 != 1 ||
|
||||
+ crtc_state->adjusted_mode.vsync_end % 2 != 1 ||
|
||||
+ crtc_state->adjusted_mode.vtotal % 2 != 1))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* progressive mode is hard-wired to 262 total lines */
|
||||
+ if (!(crtc_state->adjusted_mode.flags &
|
||||
+ DRM_MODE_FLAG_INTERLACE) &&
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal != 262)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
+ case 625:
|
||||
+ if (crtc_state->adjusted_mode.crtc_vdisplay < 1 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vdisplay > 305 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_start -
|
||||
+ crtc_state->adjusted_mode.crtc_vdisplay < 1 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_end -
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_start != 3 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal -
|
||||
+ crtc_state->adjusted_mode.crtc_vsync_end < 2 ||
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal > 312)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if ((crtc_state->adjusted_mode.flags &
|
||||
+ DRM_MODE_FLAG_INTERLACE) &&
|
||||
+ (crtc_state->adjusted_mode.vdisplay % 2 != 0 ||
|
||||
+ crtc_state->adjusted_mode.vsync_start % 2 != 0 ||
|
||||
+ crtc_state->adjusted_mode.vsync_end % 2 != 0 ||
|
||||
+ crtc_state->adjusted_mode.vtotal % 2 != 1))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* progressive mode is hard-wired to 312 total lines */
|
||||
+ if (!(crtc_state->adjusted_mode.flags &
|
||||
+ DRM_MODE_FLAG_INTERLACE) &&
|
||||
+ crtc_state->adjusted_mode.crtc_vtotal != 312)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
static const struct drm_encoder_helper_funcs vc4_vec_encoder_helper_funcs = {
|
||||
+ .atomic_check = vc4_vec_encoder_atomic_check,
|
||||
.atomic_disable = vc4_vec_encoder_disable,
|
||||
.atomic_enable = vc4_vec_encoder_enable,
|
||||
};
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
From 09808a6c08035e65489823190a276761d591f0b8 Mon Sep 17 00:00:00 2001
|
||||
From: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
Date: Thu, 15 Jul 2021 01:08:11 +0200
|
||||
Subject: [PATCH 016/726] drm/vc4: Make VEC progressive modes readily
|
||||
accessible
|
||||
|
||||
Add predefined modelines for the 240p (NTSC) and 288p (PAL) progressive
|
||||
modes, and report them through vc4_vec_connector_get_modes().
|
||||
|
||||
Signed-off-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_vec.c | 73 ++++++++++++++++++++++++++---------
|
||||
1 file changed, 55 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
index e32a7b45b2b9..32ca0b3d1549 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_vec.c
|
||||
@@ -228,7 +228,8 @@ enum vc4_vec_tv_mode_id {
|
||||
};
|
||||
|
||||
struct vc4_vec_tv_mode {
|
||||
- const struct drm_display_mode *mode;
|
||||
+ const struct drm_display_mode *interlaced_mode;
|
||||
+ const struct drm_display_mode *progressive_mode;
|
||||
u32 config0;
|
||||
u32 config1;
|
||||
u32 custom_freq;
|
||||
@@ -262,61 +263,81 @@ static const struct debugfs_reg32 vec_regs[] = {
|
||||
};
|
||||
|
||||
static const struct drm_display_mode drm_mode_480i = {
|
||||
- DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
+ DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0,
|
||||
480, 480 + 7, 480 + 7 + 6, 525, 0,
|
||||
DRM_MODE_FLAG_INTERLACE)
|
||||
};
|
||||
|
||||
+static const struct drm_display_mode drm_mode_240p = {
|
||||
+ DRM_MODE("720x240", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
+ 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0,
|
||||
+ 240, 240 + 3, 240 + 3 + 3, 262, 0, 0)
|
||||
+};
|
||||
+
|
||||
static const struct drm_display_mode drm_mode_576i = {
|
||||
- DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
+ DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0,
|
||||
576, 576 + 4, 576 + 4 + 6, 625, 0,
|
||||
DRM_MODE_FLAG_INTERLACE)
|
||||
};
|
||||
|
||||
+static const struct drm_display_mode drm_mode_288p = {
|
||||
+ DRM_MODE("720x288", DRM_MODE_TYPE_DRIVER, 13500,
|
||||
+ 720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0,
|
||||
+ 288, 288 + 2, 288 + 2 + 3, 312, 0, 0)
|
||||
+};
|
||||
+
|
||||
static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = {
|
||||
[VC4_VEC_TV_MODE_NTSC] = {
|
||||
- .mode = &drm_mode_480i,
|
||||
+ .interlaced_mode = &drm_mode_480i,
|
||||
+ .progressive_mode = &drm_mode_240p,
|
||||
.config0 = VEC_CONFIG0_NTSC_STD | VEC_CONFIG0_PDEN,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_NTSC_J] = {
|
||||
- .mode = &drm_mode_480i,
|
||||
+ .interlaced_mode = &drm_mode_480i,
|
||||
+ .progressive_mode = &drm_mode_240p,
|
||||
.config0 = VEC_CONFIG0_NTSC_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_NTSC_443] = {
|
||||
/* NTSC with PAL chroma frequency */
|
||||
- .mode = &drm_mode_480i,
|
||||
+ .interlaced_mode = &drm_mode_480i,
|
||||
+ .progressive_mode = &drm_mode_240p,
|
||||
.config0 = VEC_CONFIG0_NTSC_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ,
|
||||
.custom_freq = 0x2a098acb,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL] = {
|
||||
- .mode = &drm_mode_576i,
|
||||
+ .interlaced_mode = &drm_mode_576i,
|
||||
+ .progressive_mode = &drm_mode_288p,
|
||||
.config0 = VEC_CONFIG0_PAL_BDGHI_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL_M] = {
|
||||
- .mode = &drm_mode_480i,
|
||||
+ .interlaced_mode = &drm_mode_480i,
|
||||
+ .progressive_mode = &drm_mode_240p,
|
||||
.config0 = VEC_CONFIG0_PAL_M_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL_N] = {
|
||||
- .mode = &drm_mode_576i,
|
||||
+ .interlaced_mode = &drm_mode_576i,
|
||||
+ .progressive_mode = &drm_mode_288p,
|
||||
.config0 = VEC_CONFIG0_PAL_N_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_PAL60] = {
|
||||
/* PAL-M with chroma frequency of regular PAL */
|
||||
- .mode = &drm_mode_480i,
|
||||
+ .interlaced_mode = &drm_mode_480i,
|
||||
+ .progressive_mode = &drm_mode_240p,
|
||||
.config0 = VEC_CONFIG0_PAL_M_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ,
|
||||
.custom_freq = 0x2a098acb,
|
||||
},
|
||||
[VC4_VEC_TV_MODE_SECAM] = {
|
||||
- .mode = &drm_mode_576i,
|
||||
+ .interlaced_mode = &drm_mode_576i,
|
||||
+ .progressive_mode = &drm_mode_288p,
|
||||
.config0 = VEC_CONFIG0_SECAM_STD,
|
||||
.config1 = VEC_CONFIG1_C_CVBS_CVBS,
|
||||
.custom_freq = 0x29c71c72,
|
||||
@@ -370,16 +391,32 @@ vc4_vec_connector_detect(struct drm_connector *connector, bool force)
|
||||
static int vc4_vec_connector_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_connector_state *state = connector->state;
|
||||
- struct drm_display_mode *mode;
|
||||
-
|
||||
- mode = drm_mode_duplicate(connector->dev,
|
||||
- vc4_vec_tv_modes[state->tv.mode].mode);
|
||||
- if (!mode) {
|
||||
+ struct drm_display_mode *interlaced_mode, *progressive_mode;
|
||||
+
|
||||
+ interlaced_mode =
|
||||
+ drm_mode_duplicate(connector->dev,
|
||||
+ vc4_vec_tv_modes[state->tv.mode].interlaced_mode);
|
||||
+ progressive_mode =
|
||||
+ drm_mode_duplicate(connector->dev,
|
||||
+ vc4_vec_tv_modes[state->tv.mode].progressive_mode);
|
||||
+ if (!interlaced_mode || !progressive_mode) {
|
||||
DRM_ERROR("Failed to create a new display mode\n");
|
||||
+ drm_mode_destroy(connector->dev, interlaced_mode);
|
||||
+ drm_mode_destroy(connector->dev, progressive_mode);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
- drm_mode_probed_add(connector, mode);
|
||||
+ if (connector->cmdline_mode.specified &&
|
||||
+ connector->cmdline_mode.refresh_specified &&
|
||||
+ !connector->cmdline_mode.interlace)
|
||||
+ /* progressive mode set at boot, let's make it preferred */
|
||||
+ progressive_mode->type |= DRM_MODE_TYPE_PREFERRED;
|
||||
+ else
|
||||
+ /* otherwise, interlaced mode is preferred */
|
||||
+ interlaced_mode->type |= DRM_MODE_TYPE_PREFERRED;
|
||||
+
|
||||
+ drm_mode_probed_add(connector, interlaced_mode);
|
||||
+ drm_mode_probed_add(connector, progressive_mode);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -576,7 +613,7 @@ static int vc4_vec_encoder_atomic_check(struct drm_encoder *encoder,
|
||||
struct drm_connector_state *conn_state)
|
||||
{
|
||||
const struct drm_display_mode *reference_mode =
|
||||
- vc4_vec_tv_modes[conn_state->tv.mode].mode;
|
||||
+ vc4_vec_tv_modes[conn_state->tv.mode].interlaced_mode;
|
||||
|
||||
if (crtc_state->adjusted_mode.crtc_clock != reference_mode->clock ||
|
||||
crtc_state->adjusted_mode.crtc_htotal != reference_mode->htotal ||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
From 88be983e4c31d684dfd3bd1eab577053d46b9802 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 2 Nov 2021 16:01:36 +0000
|
||||
Subject: [PATCH 017/726] drm: Check whether the gamma lut has changed before
|
||||
updating
|
||||
|
||||
drm_crtc_legacy_gamma_set updates the gamma_lut blob unconditionally,
|
||||
which leads to unnecessary reprogramming of hardware.
|
||||
|
||||
Check whether the blob contents has actually changed before
|
||||
signalling that it has been updated.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_color_mgmt.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
|
||||
index d021497841b8..996f12438016 100644
|
||||
--- a/drivers/gpu/drm/drm_color_mgmt.c
|
||||
+++ b/drivers/gpu/drm/drm_color_mgmt.c
|
||||
@@ -330,7 +330,9 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc,
|
||||
replaced = drm_property_replace_blob(&crtc_state->degamma_lut,
|
||||
use_gamma_lut ? NULL : blob);
|
||||
replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
|
||||
- replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
|
||||
+ if (!crtc_state->gamma_lut || !crtc_state->gamma_lut->data ||
|
||||
+ memcmp(crtc_state->gamma_lut->data, blob_data, blob->length))
|
||||
+ replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
|
||||
use_gamma_lut ? blob : NULL);
|
||||
crtc_state->color_mgmt_changed |= replaced;
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
From a0f30695c4cb85836ba1b2bc2c47568d3d0caf0e Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 8 Nov 2021 17:32:45 +0000
|
||||
Subject: [PATCH 018/726] drm/vc4: Enable gamma block only when required.
|
||||
|
||||
With HVS5 the gamma block is now only reprogrammed with
|
||||
a disable/enable. Loading the table from vc4_hvs_init_channel
|
||||
(called from vc4_hvs_atomic_enable) appears to be at an
|
||||
invalid point in time and so isn't applied.
|
||||
|
||||
Switch to enabling and disabling the gamma table instead. This
|
||||
isn't safe if the pipeline is running, but it isn't now.
|
||||
For HVS4 it is safe to enable and disable dynamically, so
|
||||
adopt that approach there too.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 22 ++++++++++++++++------
|
||||
1 file changed, 16 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 950d719a126b..7ce6b713b020 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -546,8 +546,11 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
|
||||
dispbkgndx &= ~SCALER_DISPBKGND_GAMMA;
|
||||
dispbkgndx &= ~SCALER_DISPBKGND_INTERLACE;
|
||||
|
||||
+ if (crtc->state->gamma_lut)
|
||||
+ /* Enable gamma on if required */
|
||||
+ dispbkgndx |= SCALER_DISPBKGND_GAMMA;
|
||||
+
|
||||
HVS_WRITE(SCALER_DISPBKGNDX(chan), dispbkgndx |
|
||||
- ((!vc4->is_vc5) ? SCALER_DISPBKGND_GAMMA : 0) |
|
||||
(interlace ? SCALER_DISPBKGND_INTERLACE : 0));
|
||||
|
||||
/* Reload the LUT, since the SRAMs would have been disabled if
|
||||
@@ -816,18 +819,25 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
|
||||
u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel));
|
||||
|
||||
if (crtc->state->gamma_lut) {
|
||||
- if (!vc4->is_vc5)
|
||||
+ if (!vc4->is_vc5) {
|
||||
vc4_hvs_update_gamma_lut(hvs, vc4_crtc);
|
||||
- else
|
||||
+ dispbkgndx |= SCALER_DISPBKGND_GAMMA;
|
||||
+ } else {
|
||||
vc5_hvs_update_gamma_lut(hvs, vc4_crtc);
|
||||
-
|
||||
- dispbkgndx |= SCALER_DISPBKGND_GAMMA;
|
||||
+ }
|
||||
} else {
|
||||
/* Unsetting DISPBKGND_GAMMA skips the gamma lut step
|
||||
* in hardware, which is the same as a linear lut that
|
||||
* DRM expects us to use in absence of a user lut.
|
||||
+ *
|
||||
+ * Do NOT change state dynamically for hvs5 as it
|
||||
+ * inserts a delay in the pipeline that will cause
|
||||
+ * stalls if enabled/disabled whilst running. The other
|
||||
+ * should already be disabling/enabling the pipeline
|
||||
+ * when gamma changes.
|
||||
*/
|
||||
- dispbkgndx &= ~SCALER_DISPBKGND_GAMMA;
|
||||
+ if (!vc4->is_vc5)
|
||||
+ dispbkgndx &= ~SCALER_DISPBKGND_GAMMA;
|
||||
}
|
||||
HVS_WRITE(SCALER_DISPBKGNDX(channel), dispbkgndx);
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From 02df01a9518c1bbc613186f940a566d4337212af Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 8 Nov 2021 18:25:49 +0000
|
||||
Subject: [PATCH 019/726] drm/vc4: Only add gamma properties once.
|
||||
|
||||
Two calls were made to drm_crtc_enable_color_mgmt to add gamma
|
||||
and CTM, however they were both set to add the gamma properties,
|
||||
so they ended up added twice.
|
||||
|
||||
Fixes: 766cc6b1f7fc "drm/vc4: Add CTM support"
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index fc4e2e658e6d..7c29f67e4f73 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -1358,7 +1358,7 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc,
|
||||
/* We support CTM, but only for one CRTC at a time. It's therefore
|
||||
* implemented as private driver state in vc4_kms, not here.
|
||||
*/
|
||||
- drm_crtc_enable_color_mgmt(crtc, 0, true, crtc->gamma_size);
|
||||
+ drm_crtc_enable_color_mgmt(crtc, 0, true, 0);
|
||||
|
||||
/* Initialize the VC4 gamma LUTs */
|
||||
for (i = 0; i < crtc->gamma_size; i++) {
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From 5fea0e37bc8737b7ff3c1baf024698ee4a97b0b1 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 10 Nov 2021 16:36:12 +0000
|
||||
Subject: [PATCH 020/726] drm/vc4: Validate the size of the gamma_lut
|
||||
|
||||
Add a check to vc4_hvs_gamma_check to ensure a new non-empty
|
||||
gamma LUT is of the correct length before accepting it.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 7ce6b713b020..43ba463b6790 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -612,6 +612,16 @@ static int vc4_hvs_gamma_check(struct drm_crtc *crtc,
|
||||
if (!crtc_state->color_mgmt_changed)
|
||||
return 0;
|
||||
|
||||
+ if (crtc_state->gamma_lut) {
|
||||
+ unsigned int len = drm_color_lut_size(crtc_state->gamma_lut);
|
||||
+
|
||||
+ if (len != crtc->gamma_size) {
|
||||
+ DRM_DEBUG_KMS("Invalid LUT size; got %u, expected %u\n",
|
||||
+ len, crtc->gamma_size);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
connector = vc4_get_crtc_connector(crtc, crtc_state);
|
||||
if (!connector)
|
||||
return -EINVAL;
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 68532e9b0e106f659d2c7cdbf39019b80d6e7cd0 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 13 Jan 2022 11:30:42 +0000
|
||||
Subject: [PATCH 021/726] drm/vc4: Disable Gamma control on HVS5 due to issues
|
||||
writing the table
|
||||
|
||||
Still under investigation, but the conditions under which the HVS
|
||||
will accept values written to the gamma PWL are not straightforward.
|
||||
|
||||
Disable gamma on HVS5 again until it can be resolved to avoid
|
||||
gamma being enabled with an incorrect table.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 7c29f67e4f73..0b16fb5acd7d 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -1344,15 +1344,9 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc,
|
||||
|
||||
if (!vc4->is_vc5) {
|
||||
drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
|
||||
- } else {
|
||||
- /* This is a lie for hvs5 which uses a 16 point PWL, but it
|
||||
- * allows for something smarter than just 16 linearly spaced
|
||||
- * segments. Conversion is done in vc5_hvs_update_gamma_lut.
|
||||
- */
|
||||
- drm_mode_crtc_set_gamma_size(crtc, 256);
|
||||
+ drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
|
||||
}
|
||||
|
||||
- drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
|
||||
|
||||
if (!vc4->is_vc5) {
|
||||
/* We support CTM, but only for one CRTC at a time. It's therefore
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
From a959d296a7bf4e8f9c6f5d68b707c77828f3164d Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 8 Apr 2020 16:12:02 +0100
|
||||
Subject: [PATCH 022/726] drm/vc4_hdmi: Add Broadcast RGB property to allow
|
||||
override of RGB range
|
||||
|
||||
Copy Intel's "Broadcast RGB" property semantics to add manual override
|
||||
of the HDMI pixel range for monitors that don't abide by the content
|
||||
of the AVI Infoframe.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 104 +++++++++++++++++++++++++++++++++
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.h | 15 +++++
|
||||
2 files changed, 119 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index ea2eaf6032ca..e9cb32d3b0d5 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -57,6 +57,14 @@
|
||||
#include "vc4_hdmi_regs.h"
|
||||
#include "vc4_regs.h"
|
||||
|
||||
+/*
|
||||
+ * "Broadcast RGB" property.
|
||||
+ * Allows overriding of HDMI full or limited range RGB
|
||||
+ */
|
||||
+#define VC4_BROADCAST_RGB_AUTO 0
|
||||
+#define VC4_BROADCAST_RGB_FULL 1
|
||||
+#define VC4_BROADCAST_RGB_LIMITED 2
|
||||
+
|
||||
#define VC5_HDMI_HORZA_HFP_SHIFT 16
|
||||
#define VC5_HDMI_HORZA_HFP_MASK VC4_MASK(28, 16)
|
||||
#define VC5_HDMI_HORZA_VPOS BIT(15)
|
||||
@@ -155,6 +163,11 @@ static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi,
|
||||
{
|
||||
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
|
||||
|
||||
+ if (vc4_hdmi->broadcast_rgb == VC4_BROADCAST_RGB_LIMITED)
|
||||
+ return false;
|
||||
+ else if (vc4_hdmi->broadcast_rgb == VC4_BROADCAST_RGB_FULL)
|
||||
+ return true;
|
||||
+
|
||||
return !display->is_hdmi ||
|
||||
drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_FULL;
|
||||
}
|
||||
@@ -544,6 +557,65 @@ static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * vc4_hdmi_connector_atomic_get_property - hook for
|
||||
+ * connector->atomic_get_property.
|
||||
+ * @connector: Connector to get the property for.
|
||||
+ * @state: Connector state to retrieve the property from.
|
||||
+ * @property: Property to retrieve.
|
||||
+ * @val: Return value for the property.
|
||||
+ *
|
||||
+ * Returns the atomic property value for a digital connector.
|
||||
+ */
|
||||
+int vc4_hdmi_connector_get_property(struct drm_connector *connector,
|
||||
+ const struct drm_connector_state *state,
|
||||
+ struct drm_property *property,
|
||||
+ uint64_t *val)
|
||||
+{
|
||||
+ struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
|
||||
+ const struct vc4_hdmi_connector_state *vc4_conn_state =
|
||||
+ const_conn_state_to_vc4_hdmi_conn_state(state);
|
||||
+
|
||||
+ if (property == vc4_hdmi->broadcast_rgb_property) {
|
||||
+ *val = vc4_conn_state->broadcast_rgb;
|
||||
+ } else {
|
||||
+ DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
|
||||
+ property->base.id, property->name);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * vc4_hdmi_connector_atomic_set_property - hook for
|
||||
+ * connector->atomic_set_property.
|
||||
+ * @connector: Connector to set the property for.
|
||||
+ * @state: Connector state to set the property on.
|
||||
+ * @property: Property to set.
|
||||
+ * @val: New value for the property.
|
||||
+ *
|
||||
+ * Sets the atomic property value for a digital connector.
|
||||
+ */
|
||||
+int vc4_hdmi_connector_set_property(struct drm_connector *connector,
|
||||
+ struct drm_connector_state *state,
|
||||
+ struct drm_property *property,
|
||||
+ uint64_t val)
|
||||
+{
|
||||
+ struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
|
||||
+ struct vc4_hdmi_connector_state *vc4_conn_state =
|
||||
+ conn_state_to_vc4_hdmi_conn_state(state);
|
||||
+
|
||||
+ if (property == vc4_hdmi->broadcast_rgb_property) {
|
||||
+ vc4_conn_state->broadcast_rgb = val;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
|
||||
+ property->base.id, property->name);
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+
|
||||
static void vc4_hdmi_connector_reset(struct drm_connector *connector)
|
||||
{
|
||||
struct vc4_hdmi_connector_state *old_state =
|
||||
@@ -580,6 +652,7 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector)
|
||||
new_state->tmds_char_rate = vc4_state->tmds_char_rate;
|
||||
new_state->output_bpc = vc4_state->output_bpc;
|
||||
new_state->output_format = vc4_state->output_format;
|
||||
+ new_state->broadcast_rgb = vc4_state->broadcast_rgb;
|
||||
__drm_atomic_helper_connector_duplicate_state(connector, &new_state->base);
|
||||
|
||||
return &new_state->base;
|
||||
@@ -590,6 +663,8 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
|
||||
.reset = vc4_hdmi_connector_reset,
|
||||
.atomic_duplicate_state = vc4_hdmi_connector_duplicate_state,
|
||||
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
||||
+ .atomic_get_property = vc4_hdmi_connector_get_property,
|
||||
+ .atomic_set_property = vc4_hdmi_connector_set_property,
|
||||
};
|
||||
|
||||
static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = {
|
||||
@@ -598,6 +673,32 @@ static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs =
|
||||
.atomic_check = vc4_hdmi_connector_atomic_check,
|
||||
};
|
||||
|
||||
+static const struct drm_prop_enum_list broadcast_rgb_names[] = {
|
||||
+ { VC4_BROADCAST_RGB_AUTO, "Automatic" },
|
||||
+ { VC4_BROADCAST_RGB_FULL, "Full" },
|
||||
+ { VC4_BROADCAST_RGB_LIMITED, "Limited 16:235" },
|
||||
+};
|
||||
+
|
||||
+static void
|
||||
+vc4_hdmi_attach_broadcast_rgb_property(struct drm_device *dev,
|
||||
+ struct vc4_hdmi *vc4_hdmi)
|
||||
+{
|
||||
+ struct drm_property *prop = vc4_hdmi->broadcast_rgb_property;
|
||||
+
|
||||
+ if (!prop) {
|
||||
+ prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
|
||||
+ "Broadcast RGB",
|
||||
+ broadcast_rgb_names,
|
||||
+ ARRAY_SIZE(broadcast_rgb_names));
|
||||
+ if (!prop)
|
||||
+ return;
|
||||
+
|
||||
+ vc4_hdmi->broadcast_rgb_property = prop;
|
||||
+ }
|
||||
+
|
||||
+ drm_object_attach_property(&vc4_hdmi->connector.base, prop, 0);
|
||||
+}
|
||||
+
|
||||
static int vc4_hdmi_connector_init(struct drm_device *dev,
|
||||
struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
@@ -644,6 +745,8 @@ static int vc4_hdmi_connector_init(struct drm_device *dev,
|
||||
if (vc4_hdmi->variant->supports_hdr)
|
||||
drm_connector_attach_hdr_output_metadata_property(connector);
|
||||
|
||||
+ vc4_hdmi_attach_broadcast_rgb_property(dev, vc4_hdmi);
|
||||
+
|
||||
drm_connector_attach_encoder(connector, encoder);
|
||||
|
||||
return 0;
|
||||
@@ -1683,6 +1786,7 @@ static void vc4_hdmi_encoder_atomic_mode_set(struct drm_encoder *encoder,
|
||||
mutex_lock(&vc4_hdmi->mutex);
|
||||
drm_mode_copy(&vc4_hdmi->saved_adjusted_mode,
|
||||
&crtc_state->adjusted_mode);
|
||||
+ vc4_hdmi->broadcast_rgb = vc4_state->broadcast_rgb;
|
||||
vc4_hdmi->output_bpc = vc4_state->output_bpc;
|
||||
vc4_hdmi->output_format = vc4_state->output_format;
|
||||
mutex_unlock(&vc4_hdmi->mutex);
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
index 1ad8e8c377e2..f57bfb13fc41 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
|
||||
@@ -129,6 +129,8 @@ struct vc4_hdmi {
|
||||
|
||||
struct delayed_work scrambling_work;
|
||||
|
||||
+ struct drm_property *broadcast_rgb_property;
|
||||
+
|
||||
struct i2c_adapter *ddc;
|
||||
void __iomem *hdmicore_regs;
|
||||
void __iomem *hd_regs;
|
||||
@@ -229,6 +231,12 @@ struct vc4_hdmi {
|
||||
* for use outside of KMS hooks. Protected by @mutex.
|
||||
*/
|
||||
enum vc4_hdmi_output_format output_format;
|
||||
+
|
||||
+ /**
|
||||
+ * @broadcast_rgb: Copy of @vc4_connector_state.broadcast_rgb
|
||||
+ * for use outside of KMS hooks. Protected by @mutex.
|
||||
+ */
|
||||
+ int broadcast_rgb;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi *
|
||||
@@ -249,6 +257,7 @@ struct vc4_hdmi_connector_state {
|
||||
unsigned long long tmds_char_rate;
|
||||
unsigned int output_bpc;
|
||||
enum vc4_hdmi_output_format output_format;
|
||||
+ int broadcast_rgb;
|
||||
};
|
||||
|
||||
static inline struct vc4_hdmi_connector_state *
|
||||
@@ -257,6 +266,12 @@ conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state)
|
||||
return container_of(conn_state, struct vc4_hdmi_connector_state, base);
|
||||
}
|
||||
|
||||
+static inline const struct vc4_hdmi_connector_state *
|
||||
+const_conn_state_to_vc4_hdmi_conn_state(const struct drm_connector_state *conn_state)
|
||||
+{
|
||||
+ return container_of(conn_state, struct vc4_hdmi_connector_state, base);
|
||||
+}
|
||||
+
|
||||
void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi,
|
||||
struct vc4_hdmi_connector_state *vc4_conn_state);
|
||||
void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
From 6862ae72ae45c6ca32939613b5f61313ce6af687 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 31 Jan 2022 16:28:43 +0000
|
||||
Subject: [PATCH 023/726] drm/vc4: Add DRM 210101010 RGB formats for hvs5.
|
||||
|
||||
HVS5 supports the 210101010 RGB[A|X] formats, but they were
|
||||
missing from the DRM to HVS mapping list, so weren't available.
|
||||
Add them in.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index eb08020154f3..9ae2feb34461 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -139,6 +139,34 @@ static const struct hvs_format {
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_XRGB2101010,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .hvs5_only = true,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_ARGB2101010,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .hvs5_only = true,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_ABGR2101010,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .hvs5_only = true,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_XBGR2101010,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .hvs5_only = true,
|
||||
+ },
|
||||
};
|
||||
|
||||
static const struct hvs_format *vc4_get_hvs_format(u32 drm_format)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
From b02ecdf1fb2bf67e1139747359814af0fa499fa5 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Morgan <macromorgan@hotmail.com>
|
||||
Date: Fri, 28 Jan 2022 17:39:54 -0600
|
||||
Subject: [PATCH 024/726] drm/vc4: dpi: Support DPI interface in mode3 for
|
||||
RGB565
|
||||
|
||||
Add support for the VC4 DPI driver to utilize DPI mode 3. This is
|
||||
defined here as xxxRRRRRxxGGGGGGxxxBBBBB:
|
||||
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#parallel-display-interface-dpi
|
||||
|
||||
This mode is required to use the Geekworm MZP280 DPI display.
|
||||
|
||||
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
|
||||
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dpi.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
index 96b5d34f6bd7..a7bebfa5d5b0 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
|
||||
@@ -188,6 +188,10 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
|
||||
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1,
|
||||
DPI_FORMAT);
|
||||
break;
|
||||
+ case MEDIA_BUS_FMT_RGB565_1X24_CPADHI:
|
||||
+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_2,
|
||||
+ DPI_FORMAT);
|
||||
+ break;
|
||||
default:
|
||||
DRM_ERROR("Unknown media bus format %d\n",
|
||||
bus_format);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
From 81e03f544956f2412c6158767a5c4b61a5439123 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 1 Feb 2022 12:20:20 +0000
|
||||
Subject: [PATCH 025/726] drm/panel: Add and initialise an orientation field to
|
||||
drm_panel
|
||||
|
||||
Current usage of drm_connector_set_panel_orientation is from a panel's
|
||||
get_modes call. However if the panel orientation property doesn't
|
||||
exist on the connector at this point, then drm_mode_object triggers
|
||||
WARNs as the connector is already registered.
|
||||
|
||||
Add an orientation variable to struct drm_panel and initialise it from
|
||||
drm_panel_init.
|
||||
panel_bridge_attach can then create the property before the connector
|
||||
is registered.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/bridge/panel.c | 4 ++++
|
||||
drivers/gpu/drm/drm_panel.c | 15 ++++++++++-----
|
||||
include/drm/drm_panel.h | 8 ++++++++
|
||||
3 files changed, 22 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
|
||||
index 216af76d0042..94ecad089cba 100644
|
||||
--- a/drivers/gpu/drm/bridge/panel.c
|
||||
+++ b/drivers/gpu/drm/bridge/panel.c
|
||||
@@ -81,6 +81,10 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ /* set up connector's "panel orientation" property */
|
||||
+ drm_connector_set_panel_orientation(&panel_bridge->connector,
|
||||
+ panel_bridge->panel->orientation);
|
||||
+
|
||||
drm_connector_attach_encoder(&panel_bridge->connector,
|
||||
bridge->encoder);
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
|
||||
index f634371c717a..bee5066e9227 100644
|
||||
--- a/drivers/gpu/drm/drm_panel.c
|
||||
+++ b/drivers/gpu/drm/drm_panel.c
|
||||
@@ -61,6 +61,9 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
|
||||
panel->dev = dev;
|
||||
panel->funcs = funcs;
|
||||
panel->connector_type = connector_type;
|
||||
+
|
||||
+ panel->orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
|
||||
+ of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_panel_init);
|
||||
|
||||
@@ -289,16 +292,18 @@ int of_drm_get_panel_orientation(const struct device_node *np,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
- if (rotation == 0)
|
||||
+ if (rotation == 0) {
|
||||
*orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
|
||||
- else if (rotation == 90)
|
||||
+ } else if (rotation == 90) {
|
||||
*orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
|
||||
- else if (rotation == 180)
|
||||
+ } else if (rotation == 180) {
|
||||
*orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
|
||||
- else if (rotation == 270)
|
||||
+ } else if (rotation == 270) {
|
||||
*orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
|
||||
- else
|
||||
+ } else {
|
||||
+ DRM_ERROR("%pOF: invalid orientation %d\n", np, ret);
|
||||
return -EINVAL;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
|
||||
index 994bfcdd84c5..8ea3885cd93f 100644
|
||||
--- a/include/drm/drm_panel.h
|
||||
+++ b/include/drm/drm_panel.h
|
||||
@@ -182,6 +182,14 @@ struct drm_panel {
|
||||
*/
|
||||
int connector_type;
|
||||
|
||||
+ /**
|
||||
+ * @orientation:
|
||||
+ *
|
||||
+ * Panel orientation at initialisation. This is used to initialise the
|
||||
+ * drm_connector property for panel orientation.
|
||||
+ */
|
||||
+ enum drm_panel_orientation orientation;
|
||||
+
|
||||
/**
|
||||
* @list:
|
||||
*
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
From 93e1f00a3029b8d28b44f735b1063d989d25e280 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 17 Dec 2021 13:36:52 +0000
|
||||
Subject: [PATCH 026/726] drm/dsi: Document the meaning and spec references for
|
||||
MIPI_DSI_MODE_*
|
||||
|
||||
The MIPI_DSI_MODE_* flags have fairly terse descriptions and no reference
|
||||
to the DSI specification as to their exact meaning. Usage has therefore
|
||||
been rather fluid.
|
||||
|
||||
Extend the descriptions and provide references to the part of the
|
||||
MIPI DSI specification regarding what they mean.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
include/drm/drm_mipi_dsi.h | 38 ++++++++++++++++++++++++++------------
|
||||
1 file changed, 26 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
|
||||
index 9054a5185e1a..de21b9ff3ac0 100644
|
||||
--- a/include/drm/drm_mipi_dsi.h
|
||||
+++ b/include/drm/drm_mipi_dsi.h
|
||||
@@ -113,29 +113,43 @@ struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node);
|
||||
|
||||
/* DSI mode flags */
|
||||
|
||||
-/* video mode */
|
||||
+/* Video mode display.
|
||||
+ * Not set denotes a command mode display.
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO BIT(0)
|
||||
-/* video burst mode */
|
||||
+/* Video burst mode.
|
||||
+ * Link frequency to be configured via platform configuration.
|
||||
+ * This should always be set in conjunction with MIPI_DSI_MODE_VIDEO.
|
||||
+ * (DSI spec V1.1 8.11.4)
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO_BURST BIT(1)
|
||||
-/* video pulse mode */
|
||||
+/* Video pulse mode.
|
||||
+ * Not set denotes sync event mode. (DSI spec V1.1 8.11.2)
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO_SYNC_PULSE BIT(2)
|
||||
-/* enable auto vertical count mode */
|
||||
+/* Enable auto vertical count mode */
|
||||
#define MIPI_DSI_MODE_VIDEO_AUTO_VERT BIT(3)
|
||||
-/* enable hsync-end packets in vsync-pulse and v-porch area */
|
||||
+/* Enable hsync-end packets in vsync-pulse and v-porch area */
|
||||
#define MIPI_DSI_MODE_VIDEO_HSE BIT(4)
|
||||
-/* disable hfront-porch area */
|
||||
+/* Transmit NULL packets or LP mode during hfront-porch area.
|
||||
+ * Not set denotes sending a blanking packet instead. (DSI spec V1.1 8.11.1)
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO_NO_HFP BIT(5)
|
||||
-/* disable hback-porch area */
|
||||
+/* Transmit NULL packets or LP mode during hback-porch area.
|
||||
+ * Not set denotes sending a blanking packet instead. (DSI spec V1.1 8.11.1)
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO_NO_HBP BIT(6)
|
||||
-/* disable hsync-active area */
|
||||
+/* Transmit NULL packets or LP mode during hsync-active area.
|
||||
+ * Not set denotes sending a blanking packet instead. (DSI spec V1.1 8.11.1)
|
||||
+ */
|
||||
#define MIPI_DSI_MODE_VIDEO_NO_HSA BIT(7)
|
||||
-/* flush display FIFO on vsync pulse */
|
||||
+/* Flush display FIFO on vsync pulse */
|
||||
#define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8)
|
||||
-/* disable EoT packets in HS mode */
|
||||
+/* Disable EoT packets in HS mode. (DSI spec V1.1 8.1) */
|
||||
#define MIPI_DSI_MODE_NO_EOT_PACKET BIT(9)
|
||||
-/* device supports non-continuous clock behavior (DSI spec 5.6.1) */
|
||||
+/* Device supports non-continuous clock behavior (DSI spec V1.1 5.6.1) */
|
||||
#define MIPI_DSI_CLOCK_NON_CONTINUOUS BIT(10)
|
||||
-/* transmit data in low power */
|
||||
+/* Transmit data in low power */
|
||||
#define MIPI_DSI_MODE_LPM BIT(11)
|
||||
/* transmit data ending at the same time for all lanes within one hsync */
|
||||
#define MIPI_DSI_HS_PKT_END_ALIGNED BIT(12)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From cbf2846d88543399ccbe7757a3436deb3ffcf5e4 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 20 Jan 2022 17:29:36 +0000
|
||||
Subject: [PATCH 027/726] drm/bridge: tc358762: Ignore EPROBE_DEFER when
|
||||
logging errors
|
||||
|
||||
mipi_dsi_attach can fail due to resources not being available
|
||||
yet, therefore do not log error messages should they occur.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/bridge/tc358762.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
|
||||
index 7f4fce1aa998..0adc4864beea 100644
|
||||
--- a/drivers/gpu/drm/bridge/tc358762.c
|
||||
+++ b/drivers/gpu/drm/bridge/tc358762.c
|
||||
@@ -235,7 +235,7 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
|
||||
ret = mipi_dsi_attach(dsi);
|
||||
if (ret < 0) {
|
||||
drm_bridge_remove(&ctx->bridge);
|
||||
- dev_err(dev, "failed to attach dsi\n");
|
||||
+ dev_err_probe(dev, ret, "failed to attach dsi\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
From 7be03bf1ac1d12d398611f6337f170b9e396e2fb Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 30 Sep 2021 17:51:16 +0100
|
||||
Subject: [PATCH 028/726] drm/vc4: Rename bridge to out_bridge
|
||||
|
||||
In preparation for converting the encoder to being a bridge,
|
||||
rename the variable holding the next bridge in the chain to
|
||||
out_bridge, so that our bridge can be called bridge.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index 878e05d79e81..d9d951e9ab7c 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -556,7 +556,7 @@ struct vc4_dsi {
|
||||
|
||||
struct platform_device *pdev;
|
||||
|
||||
- struct drm_bridge *bridge;
|
||||
+ struct drm_bridge *out_bridge;
|
||||
struct list_head bridge_chain;
|
||||
|
||||
void __iomem *regs;
|
||||
@@ -800,7 +800,7 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
|
||||
if (iter->funcs->disable)
|
||||
iter->funcs->disable(iter);
|
||||
|
||||
- if (iter == dsi->bridge)
|
||||
+ if (iter == dsi->out_bridge)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1723,9 +1723,9 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
- dsi->bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0);
|
||||
- if (IS_ERR(dsi->bridge))
|
||||
- return PTR_ERR(dsi->bridge);
|
||||
+ dsi->out_bridge = drmm_of_get_bridge(drm, dev->of_node, 0, 0);
|
||||
+ if (IS_ERR(dsi->out_bridge))
|
||||
+ return PTR_ERR(dsi->out_bridge);
|
||||
|
||||
/* The esc clock rate is supposed to always be 100Mhz. */
|
||||
ret = clk_set_rate(dsi->escape_clock, 100 * 1000000);
|
||||
@@ -1751,7 +1751,7 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = drm_bridge_attach(encoder, dsi->bridge, NULL, 0);
|
||||
+ ret = drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
/* Disable the atomic helper calls into the bridge. We
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
From 4697767ccbf528bc8cc6fcd26e5f1bd09b5f1be4 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 7 Feb 2022 17:14:51 +0000
|
||||
Subject: [PATCH 029/726] drm/vc4: Move DSI initialisation to encoder_mode_set.
|
||||
|
||||
Breaking the bridge chain does not work for atomic bridges/panels
|
||||
and generally causes issues.
|
||||
We need to initialise the DSI host before the bridge pre_enables
|
||||
are called, so move that to encoder_mode_set in the same way that
|
||||
dw-mipi-dsi does.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 17 +++++++++++++----
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index d9d951e9ab7c..c1bdd903f1ad 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -867,18 +867,18 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
return true;
|
||||
}
|
||||
|
||||
-static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
+static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
+ struct drm_display_mode *mode,
|
||||
+ struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
- struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
|
||||
struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
bool debug_dump_regs = false;
|
||||
- struct drm_bridge *iter;
|
||||
unsigned long hs_clock;
|
||||
u32 ui_ns;
|
||||
/* Minimum LP state duration in escape clock cycles. */
|
||||
u32 lpx = dsi_esc_timing(60);
|
||||
- unsigned long pixel_clock_hz = mode->clock * 1000;
|
||||
+ unsigned long pixel_clock_hz = adjusted_mode->clock * 1000;
|
||||
unsigned long dsip_clock;
|
||||
unsigned long phy_clock;
|
||||
int ret;
|
||||
@@ -1105,6 +1105,14 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
~DSI_PORT_BIT(PHY_AFEC0_RESET));
|
||||
|
||||
vc4_dsi_ulps(dsi, false);
|
||||
+}
|
||||
+
|
||||
+static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
+{
|
||||
+ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
|
||||
+ struct vc4_dsi *dsi = vc4_encoder->dsi;
|
||||
+ bool debug_dump_regs = false;
|
||||
+ struct drm_bridge *iter;
|
||||
|
||||
list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
|
||||
if (iter->funcs->pre_enable)
|
||||
@@ -1370,6 +1378,7 @@ static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
|
||||
.disable = vc4_dsi_encoder_disable,
|
||||
.enable = vc4_dsi_encoder_enable,
|
||||
.mode_fixup = vc4_dsi_encoder_mode_fixup,
|
||||
+ .mode_set = vc4_dsi_encoder_mode_set,
|
||||
};
|
||||
|
||||
static int vc4_dsi_late_register(struct drm_encoder *encoder)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
From 41e229c3c11c78088d7bbc0f680d00fa79116df6 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 15 Dec 2021 17:44:49 +0000
|
||||
Subject: [PATCH 030/726] drm/vc4: Remove splitting the bridge chain from the
|
||||
driver.
|
||||
|
||||
Splitting the bridge chain fails for atomic bridges as the
|
||||
framework can't add the relevant state in
|
||||
drm_atomic_add_encoder_bridges.
|
||||
The chain was split because we needed to power up before
|
||||
calling pre_enable, but that is now done in mode_set, and will
|
||||
move into the framework.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 47 -----------------------------------
|
||||
1 file changed, 47 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index c1bdd903f1ad..9109bee6c7d2 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -557,7 +557,6 @@ struct vc4_dsi {
|
||||
struct platform_device *pdev;
|
||||
|
||||
struct drm_bridge *out_bridge;
|
||||
- struct list_head bridge_chain;
|
||||
|
||||
void __iomem *regs;
|
||||
|
||||
@@ -794,23 +793,9 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
|
||||
{
|
||||
struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
- struct drm_bridge *iter;
|
||||
-
|
||||
- list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->disable)
|
||||
- iter->funcs->disable(iter);
|
||||
-
|
||||
- if (iter == dsi->out_bridge)
|
||||
- break;
|
||||
- }
|
||||
|
||||
vc4_dsi_ulps(dsi, true);
|
||||
|
||||
- list_for_each_entry_from(iter, &dsi->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->post_disable)
|
||||
- iter->funcs->post_disable(iter);
|
||||
- }
|
||||
-
|
||||
clk_disable_unprepare(dsi->pll_phy_clock);
|
||||
clk_disable_unprepare(dsi->escape_clock);
|
||||
clk_disable_unprepare(dsi->pixel_clock);
|
||||
@@ -1112,12 +1097,6 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
|
||||
struct vc4_dsi *dsi = vc4_encoder->dsi;
|
||||
bool debug_dump_regs = false;
|
||||
- struct drm_bridge *iter;
|
||||
-
|
||||
- list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->pre_enable)
|
||||
- iter->funcs->pre_enable(iter);
|
||||
- }
|
||||
|
||||
if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
|
||||
DSI_PORT_WRITE(DISP0_CTRL,
|
||||
@@ -1134,11 +1113,6 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
DSI_DISP0_ENABLE);
|
||||
}
|
||||
|
||||
- list_for_each_entry(iter, &dsi->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->enable)
|
||||
- iter->funcs->enable(iter);
|
||||
- }
|
||||
-
|
||||
if (debug_dump_regs) {
|
||||
struct drm_printer p = drm_info_printer(&dsi->pdev->dev);
|
||||
dev_info(&dsi->pdev->dev, "DSI regs after:\n");
|
||||
@@ -1626,7 +1600,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
||||
|
||||
dsi->variant = of_device_get_match_data(dev);
|
||||
|
||||
- INIT_LIST_HEAD(&dsi->bridge_chain);
|
||||
dsi->encoder.type = dsi->variant->port ?
|
||||
VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
|
||||
|
||||
@@ -1763,32 +1736,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
||||
ret = drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
- /* Disable the atomic helper calls into the bridge. We
|
||||
- * manually call the bridge pre_enable / enable / etc. calls
|
||||
- * from our driver, since we need to sequence them within the
|
||||
- * encoder's enable/disable paths.
|
||||
- */
|
||||
- list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void vc4_dsi_unbind(struct device *dev, struct device *master,
|
||||
- void *data)
|
||||
-{
|
||||
- struct vc4_dsi *dsi = dev_get_drvdata(dev);
|
||||
- struct drm_encoder *encoder = &dsi->encoder.base;
|
||||
-
|
||||
- /*
|
||||
- * Restore the bridge_chain so the bridge detach procedure can happen
|
||||
- * normally.
|
||||
- */
|
||||
- list_splice_init(&dsi->bridge_chain, &encoder->bridge_chain);
|
||||
-}
|
||||
-
|
||||
static const struct component_ops vc4_dsi_ops = {
|
||||
.bind = vc4_dsi_bind,
|
||||
- .unbind = vc4_dsi_unbind,
|
||||
};
|
||||
|
||||
static int vc4_dsi_dev_probe(struct platform_device *pdev)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
From 3d56b528385fe539cd244eb1fd1d3560217e52d7 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 15 Dec 2021 17:47:14 +0000
|
||||
Subject: [PATCH 031/726] drm/vc4: Convert vc4_dsi to use atomic
|
||||
enable/disable/mode_set.
|
||||
|
||||
The atomic calls are preferred as the non-atomic ones
|
||||
are deprecated. In preparation for conversion to a bridge,
|
||||
switch to the atomic calls.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 23 +++++++++++++++--------
|
||||
1 file changed, 15 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index 9109bee6c7d2..4fd4b05d7530 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -789,7 +789,8 @@ dsi_esc_timing(u32 ns)
|
||||
return DIV_ROUND_UP(ns, ESC_TIME_NS);
|
||||
}
|
||||
|
||||
-static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
|
||||
+static void vc4_dsi_encoder_disable(struct drm_encoder *encoder,
|
||||
+ struct drm_atomic_state *state)
|
||||
{
|
||||
struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
@@ -853,17 +854,18 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
}
|
||||
|
||||
static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
- struct drm_display_mode *mode,
|
||||
- struct drm_display_mode *adjusted_mode)
|
||||
+ struct drm_crtc_state *crtc_state,
|
||||
+ struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
+ const struct drm_display_mode *mode;
|
||||
bool debug_dump_regs = false;
|
||||
unsigned long hs_clock;
|
||||
u32 ui_ns;
|
||||
/* Minimum LP state duration in escape clock cycles. */
|
||||
u32 lpx = dsi_esc_timing(60);
|
||||
- unsigned long pixel_clock_hz = adjusted_mode->clock * 1000;
|
||||
+ unsigned long pixel_clock_hz;
|
||||
unsigned long dsip_clock;
|
||||
unsigned long phy_clock;
|
||||
int ret;
|
||||
@@ -880,6 +882,10 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
drm_print_regset32(&p, &dsi->regset);
|
||||
}
|
||||
|
||||
+ mode = &crtc_state->adjusted_mode;
|
||||
+
|
||||
+ pixel_clock_hz = mode->clock * 1000;
|
||||
+
|
||||
/* Round up the clk_set_rate() request slightly, since
|
||||
* PLLD_DSI1 is an integer divider and its rate selection will
|
||||
* never round up.
|
||||
@@ -1092,7 +1098,8 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
vc4_dsi_ulps(dsi, false);
|
||||
}
|
||||
|
||||
-static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
|
||||
+static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
|
||||
+ struct drm_atomic_state *state)
|
||||
{
|
||||
struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
|
||||
struct vc4_dsi *dsi = vc4_encoder->dsi;
|
||||
@@ -1349,10 +1356,10 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {
|
||||
};
|
||||
|
||||
static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
|
||||
- .disable = vc4_dsi_encoder_disable,
|
||||
- .enable = vc4_dsi_encoder_enable,
|
||||
+ .atomic_disable = vc4_dsi_encoder_disable,
|
||||
+ .atomic_enable = vc4_dsi_encoder_enable,
|
||||
.mode_fixup = vc4_dsi_encoder_mode_fixup,
|
||||
- .mode_set = vc4_dsi_encoder_mode_set,
|
||||
+ .atomic_mode_set = vc4_dsi_encoder_mode_set,
|
||||
};
|
||||
|
||||
static int vc4_dsi_late_register(struct drm_encoder *encoder)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,271 +0,0 @@
|
|||
From 3f0869e44d8e64f3955c1a81e1c320ad88454016 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 15 Dec 2021 17:57:45 +0000
|
||||
Subject: [PATCH 032/726] drm/vc4: Convert vc4_dsi to using a bridge instead of
|
||||
encoder.
|
||||
|
||||
Remove the encoder functions, and create a bridge attached to
|
||||
this dumb encoder which implements the same functionality.
|
||||
|
||||
As a bridge has state which an encoder doesn't, we need to
|
||||
add the state management functions as well.
|
||||
|
||||
As there is no bridge atomic_mode_set, move the initialisation
|
||||
code that was in mode_set into _pre_enable.
|
||||
The code to actually enable and disable sending video are split
|
||||
from the general control into _enable and _disable.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 122 +++++++++++++++++++++++++---------
|
||||
1 file changed, 90 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index 4fd4b05d7530..a7b8ffd995b0 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -557,6 +557,7 @@ struct vc4_dsi {
|
||||
struct platform_device *pdev;
|
||||
|
||||
struct drm_bridge *out_bridge;
|
||||
+ struct drm_bridge bridge;
|
||||
|
||||
void __iomem *regs;
|
||||
|
||||
@@ -608,6 +609,12 @@ to_vc4_dsi(struct drm_encoder *encoder)
|
||||
return container_of(encoder, struct vc4_dsi, encoder.base);
|
||||
}
|
||||
|
||||
+static inline struct vc4_dsi *
|
||||
+bridge_to_vc4_dsi(struct drm_bridge *bridge)
|
||||
+{
|
||||
+ return container_of(bridge, struct vc4_dsi, bridge);
|
||||
+}
|
||||
+
|
||||
static inline void
|
||||
dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
|
||||
{
|
||||
@@ -789,10 +796,21 @@ dsi_esc_timing(u32 ns)
|
||||
return DIV_ROUND_UP(ns, ESC_TIME_NS);
|
||||
}
|
||||
|
||||
-static void vc4_dsi_encoder_disable(struct drm_encoder *encoder,
|
||||
- struct drm_atomic_state *state)
|
||||
+static void vc4_dsi_bridge_disable(struct drm_bridge *bridge,
|
||||
+ struct drm_bridge_state *state)
|
||||
{
|
||||
- struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
+ u32 disp0_ctrl;
|
||||
+
|
||||
+ disp0_ctrl = DSI_PORT_READ(DISP0_CTRL);
|
||||
+ disp0_ctrl &= ~DSI_DISP0_ENABLE;
|
||||
+ DSI_PORT_WRITE(DISP0_CTRL, disp0_ctrl);
|
||||
+}
|
||||
+
|
||||
+static void vc4_dsi_bridge_post_disable(struct drm_bridge *bridge,
|
||||
+ struct drm_bridge_state *state)
|
||||
+{
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
|
||||
vc4_dsi_ulps(dsi, true);
|
||||
@@ -817,11 +835,11 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder,
|
||||
* higher-than-expected clock rate to the panel, but that's what the
|
||||
* firmware does too.
|
||||
*/
|
||||
-static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
- const struct drm_display_mode *mode,
|
||||
- struct drm_display_mode *adjusted_mode)
|
||||
+static bool vc4_dsi_bridge_mode_fixup(struct drm_bridge *bridge,
|
||||
+ const struct drm_display_mode *mode,
|
||||
+ struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
- struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
struct clk *phy_parent = clk_get_parent(dsi->pll_phy_clock);
|
||||
unsigned long parent_rate = clk_get_rate(phy_parent);
|
||||
unsigned long pixel_clock_hz = mode->clock * 1000;
|
||||
@@ -853,15 +871,18 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
return true;
|
||||
}
|
||||
|
||||
-static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
- struct drm_crtc_state *crtc_state,
|
||||
- struct drm_connector_state *conn_state)
|
||||
+static void vc4_dsi_bridge_pre_enable(struct drm_bridge *bridge,
|
||||
+ struct drm_bridge_state *old_state)
|
||||
{
|
||||
- struct vc4_dsi *dsi = to_vc4_dsi(encoder);
|
||||
+ struct drm_atomic_state *state = old_state->base.state;
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
+ const struct drm_crtc_state *crtc_state;
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
const struct drm_display_mode *mode;
|
||||
+ struct drm_connector *connector;
|
||||
bool debug_dump_regs = false;
|
||||
unsigned long hs_clock;
|
||||
+ struct drm_crtc *crtc;
|
||||
u32 ui_ns;
|
||||
/* Minimum LP state duration in escape clock cycles. */
|
||||
u32 lpx = dsi_esc_timing(60);
|
||||
@@ -882,6 +903,14 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
drm_print_regset32(&p, &dsi->regset);
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Retrieve the CRTC adjusted mode. This requires a little dance to go
|
||||
+ * from the bridge to the encoder, to the connector and to the CRTC.
|
||||
+ */
|
||||
+ connector = drm_atomic_get_new_connector_for_encoder(state,
|
||||
+ bridge->encoder);
|
||||
+ crtc = drm_atomic_get_new_connector_state(state, connector)->crtc;
|
||||
+ crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
|
||||
mode = &crtc_state->adjusted_mode;
|
||||
|
||||
pixel_clock_hz = mode->clock * 1000;
|
||||
@@ -1096,14 +1125,6 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
~DSI_PORT_BIT(PHY_AFEC0_RESET));
|
||||
|
||||
vc4_dsi_ulps(dsi, false);
|
||||
-}
|
||||
-
|
||||
-static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
|
||||
- struct drm_atomic_state *state)
|
||||
-{
|
||||
- struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
|
||||
- struct vc4_dsi *dsi = vc4_encoder->dsi;
|
||||
- bool debug_dump_regs = false;
|
||||
|
||||
if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
|
||||
DSI_PORT_WRITE(DISP0_CTRL,
|
||||
@@ -1112,13 +1133,23 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
|
||||
VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) |
|
||||
VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME,
|
||||
DSI_DISP0_LP_STOP_CTRL) |
|
||||
- DSI_DISP0_ST_END |
|
||||
- DSI_DISP0_ENABLE);
|
||||
+ DSI_DISP0_ST_END);
|
||||
} else {
|
||||
DSI_PORT_WRITE(DISP0_CTRL,
|
||||
- DSI_DISP0_COMMAND_MODE |
|
||||
- DSI_DISP0_ENABLE);
|
||||
+ DSI_DISP0_COMMAND_MODE);
|
||||
}
|
||||
+}
|
||||
+
|
||||
+static void vc4_dsi_bridge_enable(struct drm_bridge *bridge,
|
||||
+ struct drm_bridge_state *old_state)
|
||||
+{
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
+ bool debug_dump_regs = false;
|
||||
+ u32 disp0_ctrl;
|
||||
+
|
||||
+ disp0_ctrl = DSI_PORT_READ(DISP0_CTRL);
|
||||
+ disp0_ctrl |= DSI_DISP0_ENABLE;
|
||||
+ DSI_PORT_WRITE(DISP0_CTRL, disp0_ctrl);
|
||||
|
||||
if (debug_dump_regs) {
|
||||
struct drm_printer p = drm_info_printer(&dsi->pdev->dev);
|
||||
@@ -1127,6 +1158,16 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
|
||||
}
|
||||
}
|
||||
|
||||
+static int vc4_dsi_bridge_attach(struct drm_bridge *bridge,
|
||||
+ enum drm_bridge_attach_flags flags)
|
||||
+{
|
||||
+ struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
+
|
||||
+ /* Attach the panel or bridge to the dsi bridge */
|
||||
+ return drm_bridge_attach(bridge->encoder, dsi->out_bridge,
|
||||
+ &dsi->bridge, flags);
|
||||
+}
|
||||
+
|
||||
static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
const struct mipi_dsi_msg *msg)
|
||||
{
|
||||
@@ -1303,6 +1344,7 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host,
|
||||
struct mipi_dsi_device *device)
|
||||
{
|
||||
struct vc4_dsi *dsi = host_to_dsi(host);
|
||||
+ int ret;
|
||||
|
||||
dsi->lanes = device->lanes;
|
||||
dsi->channel = device->channel;
|
||||
@@ -1337,7 +1379,15 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host,
|
||||
return 0;
|
||||
}
|
||||
|
||||
- return component_add(&dsi->pdev->dev, &vc4_dsi_ops);
|
||||
+ drm_bridge_add(&dsi->bridge);
|
||||
+
|
||||
+ ret = component_add(&dsi->pdev->dev, &vc4_dsi_ops);
|
||||
+ if (ret) {
|
||||
+ drm_bridge_remove(&dsi->bridge);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int vc4_dsi_host_detach(struct mipi_dsi_host *host,
|
||||
@@ -1346,6 +1396,7 @@ static int vc4_dsi_host_detach(struct mipi_dsi_host *host,
|
||||
struct vc4_dsi *dsi = host_to_dsi(host);
|
||||
|
||||
component_del(&dsi->pdev->dev, &vc4_dsi_ops);
|
||||
+ drm_bridge_remove(&dsi->bridge);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1355,11 +1406,16 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {
|
||||
.transfer = vc4_dsi_host_transfer,
|
||||
};
|
||||
|
||||
-static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
|
||||
- .atomic_disable = vc4_dsi_encoder_disable,
|
||||
- .atomic_enable = vc4_dsi_encoder_enable,
|
||||
- .mode_fixup = vc4_dsi_encoder_mode_fixup,
|
||||
- .atomic_mode_set = vc4_dsi_encoder_mode_set,
|
||||
+static const struct drm_bridge_funcs vc4_dsi_bridge_funcs = {
|
||||
+ .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
|
||||
+ .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
|
||||
+ .atomic_reset = drm_atomic_helper_bridge_reset,
|
||||
+ .atomic_pre_enable = vc4_dsi_bridge_pre_enable,
|
||||
+ .atomic_enable = vc4_dsi_bridge_enable,
|
||||
+ .atomic_disable = vc4_dsi_bridge_disable,
|
||||
+ .atomic_post_disable = vc4_dsi_bridge_post_disable,
|
||||
+ .attach = vc4_dsi_bridge_attach,
|
||||
+ .mode_fixup = vc4_dsi_bridge_mode_fixup,
|
||||
};
|
||||
|
||||
static int vc4_dsi_late_register(struct drm_encoder *encoder)
|
||||
@@ -1734,13 +1790,11 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- drm_encoder_helper_add(encoder, &vc4_dsi_encoder_helper_funcs);
|
||||
-
|
||||
ret = devm_pm_runtime_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = drm_bridge_attach(encoder, dsi->out_bridge, NULL, 0);
|
||||
+ ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1762,7 +1816,11 @@ static int vc4_dsi_dev_probe(struct platform_device *pdev)
|
||||
dev_set_drvdata(dev, dsi);
|
||||
|
||||
kref_init(&dsi->kref);
|
||||
+
|
||||
dsi->pdev = pdev;
|
||||
+ dsi->bridge.funcs = &vc4_dsi_bridge_funcs;
|
||||
+ dsi->bridge.of_node = dev->of_node;
|
||||
+ dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
|
||||
dsi->dsi_host.ops = &vc4_dsi_host_ops;
|
||||
dsi->dsi_host.dev = dev;
|
||||
mipi_dsi_host_register(&dsi->dsi_host);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From 15b29434119e5fe567b49aab8efe26d02caeeb37 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 11 Feb 2022 14:15:26 +0000
|
||||
Subject: [PATCH 033/726] drm/vc4: Remove entry to ULPS from vc4_dsi
|
||||
post_disable
|
||||
|
||||
Post_disable was sending the D-PHY sequence to put any device
|
||||
into ULPS suspend mode, and then cutting power to the DSI block.
|
||||
The power-on reset state of the DSI block is for DSI to be in
|
||||
an operational state, not ULPS, so it then never sent the sequence
|
||||
for exiting ULPS. Any attached device that didn't have an external
|
||||
reset therefore remained in ULPS / standby, and didn't function.
|
||||
|
||||
Use of ULPS isn't well specified in DRM, therefore remove entering
|
||||
it to avoid the above situation.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_dsi.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
index a7b8ffd995b0..4f3805528aa1 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
|
||||
@@ -813,8 +813,6 @@ static void vc4_dsi_bridge_post_disable(struct drm_bridge *bridge,
|
||||
struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
|
||||
struct device *dev = &dsi->pdev->dev;
|
||||
|
||||
- vc4_dsi_ulps(dsi, true);
|
||||
-
|
||||
clk_disable_unprepare(dsi->pll_phy_clock);
|
||||
clk_disable_unprepare(dsi->escape_clock);
|
||||
clk_disable_unprepare(dsi->pixel_clock);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,315 +0,0 @@
|
|||
From 52fa9a4c3b78b5fd6fbe8c8e32c95f161cc116b2 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 16 Dec 2021 15:25:35 +0000
|
||||
Subject: [PATCH 034/726] drm/bridge: Introduce pre_enable_upstream_first to
|
||||
alter bridge init order
|
||||
|
||||
DSI sink devices typically want the DSI host powered up and configured
|
||||
before they are powered up. pre_enable is the place this would normally
|
||||
happen, but they are called in reverse order from panel/connector towards
|
||||
the encoder, which is the "wrong" order.
|
||||
|
||||
Add a new flag pre_enable_upstream_first that any bridge can set
|
||||
to swap the order of pre_enable (and post_disable) for that and the
|
||||
immediately upstream bridge.
|
||||
Should the immediately upstream bridge also set the
|
||||
pre_enable_upstream_first flag, the bridge upstream of that will be called
|
||||
before either of those which requested pre_enable_upstream_first.
|
||||
|
||||
eg:
|
||||
- Panel
|
||||
- Bridge 1
|
||||
- Bridge 2 pre_enable_upstream_first
|
||||
- Bridge 3
|
||||
- Bridge 4 pre_enable_upstream_first
|
||||
- Bridge 5 pre_enable_upstream_first
|
||||
- Bridge 6
|
||||
- Encoder
|
||||
Would result in pre_enable's being called as Panel, Bridge 1, Bridge 3,
|
||||
Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_bridge.c | 177 +++++++++++++++++++++++++----------
|
||||
include/drm/drm_bridge.h | 8 ++
|
||||
2 files changed, 137 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
|
||||
index 1545c50fd1c8..441d781c3da1 100644
|
||||
--- a/drivers/gpu/drm/drm_bridge.c
|
||||
+++ b/drivers/gpu/drm/drm_bridge.c
|
||||
@@ -547,20 +547,15 @@ EXPORT_SYMBOL(drm_bridge_chain_disable);
|
||||
* encoder chain, starting from the first bridge to the last. These are called
|
||||
* after completing the encoder's prepare op.
|
||||
*
|
||||
+ * If a bridge sets @pre_enable_upstream_first, then the @post_disable for that
|
||||
+ * bridge will be called before the previous one to reverse the @pre_enable
|
||||
+ * calling direction.
|
||||
+ *
|
||||
* Note: the bridge passed should be the one closest to the encoder
|
||||
*/
|
||||
void drm_bridge_chain_post_disable(struct drm_bridge *bridge)
|
||||
{
|
||||
- struct drm_encoder *encoder;
|
||||
-
|
||||
- if (!bridge)
|
||||
- return;
|
||||
-
|
||||
- encoder = bridge->encoder;
|
||||
- list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) {
|
||||
- if (bridge->funcs->post_disable)
|
||||
- bridge->funcs->post_disable(bridge);
|
||||
- }
|
||||
+ drm_atomic_bridge_chain_post_disable(bridge, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_bridge_chain_post_disable);
|
||||
|
||||
@@ -602,24 +597,14 @@ EXPORT_SYMBOL(drm_bridge_chain_mode_set);
|
||||
* chain, starting from the last bridge to the first. These are called
|
||||
* before calling the encoder's commit op.
|
||||
*
|
||||
+ * If a bridge sets @pre_enable_upstream_first, then the @pre_enable for the
|
||||
+ * previous bridge will be called before @pre_enable of this bridge.
|
||||
+ *
|
||||
* Note: the bridge passed should be the one closest to the encoder
|
||||
*/
|
||||
void drm_bridge_chain_pre_enable(struct drm_bridge *bridge)
|
||||
{
|
||||
- struct drm_encoder *encoder;
|
||||
- struct drm_bridge *iter;
|
||||
-
|
||||
- if (!bridge)
|
||||
- return;
|
||||
-
|
||||
- encoder = bridge->encoder;
|
||||
- list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->pre_enable)
|
||||
- iter->funcs->pre_enable(iter);
|
||||
-
|
||||
- if (iter == bridge)
|
||||
- break;
|
||||
- }
|
||||
+ drm_atomic_bridge_chain_pre_enable(bridge, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_bridge_chain_pre_enable);
|
||||
|
||||
@@ -691,6 +676,25 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge,
|
||||
}
|
||||
EXPORT_SYMBOL(drm_atomic_bridge_chain_disable);
|
||||
|
||||
+static void drm_atomic_bridge_call_post_disable(struct drm_bridge *bridge,
|
||||
+ struct drm_atomic_state *old_state)
|
||||
+{
|
||||
+ if (old_state && bridge->funcs->atomic_post_disable) {
|
||||
+ struct drm_bridge_state *old_bridge_state;
|
||||
+
|
||||
+ old_bridge_state =
|
||||
+ drm_atomic_get_old_bridge_state(old_state,
|
||||
+ bridge);
|
||||
+ if (WARN_ON(!old_bridge_state))
|
||||
+ return;
|
||||
+
|
||||
+ bridge->funcs->atomic_post_disable(bridge,
|
||||
+ old_bridge_state);
|
||||
+ } else if (bridge->funcs->post_disable) {
|
||||
+ bridge->funcs->post_disable(bridge);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* drm_atomic_bridge_chain_post_disable - cleans up after disabling all bridges
|
||||
* in the encoder chain
|
||||
@@ -701,6 +705,9 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable);
|
||||
* &drm_bridge_funcs.post_disable) op for all the bridges in the encoder chain,
|
||||
* starting from the first bridge to the last. These are called after completing
|
||||
* &drm_encoder_helper_funcs.atomic_disable
|
||||
+ * If a bridge sets @pre_enable_upstream_first, then the @post_disable for that
|
||||
+ * bridge will be called before the previous one to reverse the @pre_enable
|
||||
+ * calling direction.
|
||||
*
|
||||
* Note: the bridge passed should be the one closest to the encoder
|
||||
*/
|
||||
@@ -708,30 +715,75 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,
|
||||
struct drm_atomic_state *old_state)
|
||||
{
|
||||
struct drm_encoder *encoder;
|
||||
+ struct drm_bridge *next, *limit;
|
||||
|
||||
if (!bridge)
|
||||
return;
|
||||
|
||||
encoder = bridge->encoder;
|
||||
+
|
||||
list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) {
|
||||
- if (bridge->funcs->atomic_post_disable) {
|
||||
- struct drm_bridge_state *old_bridge_state;
|
||||
+ limit = NULL;
|
||||
+
|
||||
+ if (!list_is_last(&bridge->chain_node, &encoder->bridge_chain)) {
|
||||
+ next = list_next_entry(bridge, chain_node);
|
||||
+
|
||||
+ if (next->pre_enable_upstream_first) {
|
||||
+ /* Downstream bridge had requested that upstream
|
||||
+ * was enabled first, so disabled last
|
||||
+ */
|
||||
+ limit = next;
|
||||
+
|
||||
+ /* Find the next bridge that has NOT requested
|
||||
+ * upstream to be enabled first / disabled last
|
||||
+ */
|
||||
+ list_for_each_entry_from(next, &encoder->bridge_chain,
|
||||
+ chain_node) {
|
||||
+ if (next->pre_enable_upstream_first) {
|
||||
+ next = list_prev_entry(next, chain_node);
|
||||
+ limit = next;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Call these bridges in reverse order */
|
||||
+ list_for_each_entry_from_reverse(next, &encoder->bridge_chain,
|
||||
+ chain_node) {
|
||||
+ if (next == bridge)
|
||||
+ break;
|
||||
+
|
||||
+ drm_atomic_bridge_call_post_disable(next,
|
||||
+ old_state);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- old_bridge_state =
|
||||
- drm_atomic_get_old_bridge_state(old_state,
|
||||
- bridge);
|
||||
- if (WARN_ON(!old_bridge_state))
|
||||
- return;
|
||||
+ drm_atomic_bridge_call_post_disable(bridge, old_state);
|
||||
|
||||
- bridge->funcs->atomic_post_disable(bridge,
|
||||
- old_bridge_state);
|
||||
- } else if (bridge->funcs->post_disable) {
|
||||
- bridge->funcs->post_disable(bridge);
|
||||
- }
|
||||
+ if (limit)
|
||||
+ bridge = limit;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);
|
||||
|
||||
+static void drm_atomic_bridge_call_pre_enable(struct drm_bridge *bridge,
|
||||
+ struct drm_atomic_state *old_state)
|
||||
+{
|
||||
+ if (old_state && bridge->funcs->atomic_pre_enable) {
|
||||
+ struct drm_bridge_state *old_bridge_state;
|
||||
+
|
||||
+ old_bridge_state =
|
||||
+ drm_atomic_get_old_bridge_state(old_state,
|
||||
+ bridge);
|
||||
+ if (WARN_ON(!old_bridge_state))
|
||||
+ return;
|
||||
+
|
||||
+ bridge->funcs->atomic_pre_enable(bridge, old_bridge_state);
|
||||
+ } else if (bridge->funcs->pre_enable) {
|
||||
+ bridge->funcs->pre_enable(bridge);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* drm_atomic_bridge_chain_pre_enable - prepares for enabling all bridges in
|
||||
* the encoder chain
|
||||
@@ -743,32 +795,61 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);
|
||||
* starting from the last bridge to the first. These are called before calling
|
||||
* &drm_encoder_helper_funcs.atomic_enable
|
||||
*
|
||||
+ * If a bridge sets @pre_enable_upstream_first, then the pre_enable for the
|
||||
+ * upstream bridge will be called before pre_enable of this bridge.
|
||||
+ *
|
||||
* Note: the bridge passed should be the one closest to the encoder
|
||||
*/
|
||||
void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,
|
||||
struct drm_atomic_state *old_state)
|
||||
{
|
||||
struct drm_encoder *encoder;
|
||||
- struct drm_bridge *iter;
|
||||
+ struct drm_bridge *iter, *next, *limit;
|
||||
|
||||
if (!bridge)
|
||||
return;
|
||||
|
||||
encoder = bridge->encoder;
|
||||
+
|
||||
list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) {
|
||||
- if (iter->funcs->atomic_pre_enable) {
|
||||
- struct drm_bridge_state *old_bridge_state;
|
||||
+ if (iter->pre_enable_upstream_first) {
|
||||
+ next = iter;
|
||||
+ limit = bridge;
|
||||
+ list_for_each_entry_from_reverse(next,
|
||||
+ &encoder->bridge_chain,
|
||||
+ chain_node) {
|
||||
+ if (next == bridge)
|
||||
+ break;
|
||||
+
|
||||
+ if (!next->pre_enable_upstream_first) {
|
||||
+ /* Found first bridge that does NOT
|
||||
+ * request upstream to be enabled first
|
||||
+ */
|
||||
+ limit = list_prev_entry(next, chain_node);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ list_for_each_entry_from(next, &encoder->bridge_chain, chain_node) {
|
||||
+ /* Call requested upstream bridge pre_enable
|
||||
+ * in order.
|
||||
+ */
|
||||
+ if (next == iter)
|
||||
+ /* At the first bridgge to request upstream
|
||||
+ * bridges called first.
|
||||
+ */
|
||||
+ break;
|
||||
+
|
||||
+ drm_atomic_bridge_call_pre_enable(next, old_state);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- old_bridge_state =
|
||||
- drm_atomic_get_old_bridge_state(old_state,
|
||||
- iter);
|
||||
- if (WARN_ON(!old_bridge_state))
|
||||
- return;
|
||||
+ drm_atomic_bridge_call_pre_enable(iter, old_state);
|
||||
|
||||
- iter->funcs->atomic_pre_enable(iter, old_bridge_state);
|
||||
- } else if (iter->funcs->pre_enable) {
|
||||
- iter->funcs->pre_enable(iter);
|
||||
- }
|
||||
+ if (iter->pre_enable_upstream_first)
|
||||
+ /* Jump all bridges that we have already pre_enabled
|
||||
+ */
|
||||
+ iter = limit;
|
||||
|
||||
if (iter == bridge)
|
||||
break;
|
||||
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
|
||||
index 6b65b0dfb4fb..8a5e03e4c264 100644
|
||||
--- a/include/drm/drm_bridge.h
|
||||
+++ b/include/drm/drm_bridge.h
|
||||
@@ -768,6 +768,14 @@ struct drm_bridge {
|
||||
* modes.
|
||||
*/
|
||||
bool interlace_allowed;
|
||||
+ /**
|
||||
+ * @pre_enable_upstream_first: The bridge requires that the upstream
|
||||
+ * bridge @pre_enable function is called before its @pre_enable,
|
||||
+ * and conversely for post_disable. This is most frequently a
|
||||
+ * requirement for DSI devices which need the host to be initialised
|
||||
+ * before the peripheral.
|
||||
+ */
|
||||
+ bool pre_enable_upstream_first;
|
||||
/**
|
||||
* @ddc: Associated I2C adapter for DDC access, if any.
|
||||
*/
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
From f0f8bab8cb7c50cd1fbcb36854fe138c384f0495 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Wed, 23 Feb 2022 15:36:56 +0000
|
||||
Subject: [PATCH 035/726] drm/panel: Add prepare_upstream_first flag to
|
||||
drm_panel
|
||||
|
||||
Mapping to the drm_bridge flag pre_enable_upstream_first,
|
||||
add a new flag prepare_upstream_first to drm_panel to allow
|
||||
the panel driver to request that the upstream bridge should
|
||||
be pre_enabled before the panel prepare.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/bridge/panel.c | 3 +++
|
||||
include/drm/drm_panel.h | 10 ++++++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
|
||||
index 94ecad089cba..0c1dcf85ed13 100644
|
||||
--- a/drivers/gpu/drm/bridge/panel.c
|
||||
+++ b/drivers/gpu/drm/bridge/panel.c
|
||||
@@ -258,6 +258,9 @@ struct drm_bridge *drm_panel_bridge_add_typed(struct drm_panel *panel,
|
||||
panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES;
|
||||
panel_bridge->bridge.type = connector_type;
|
||||
|
||||
+ panel_bridge->bridge.pre_enable_upstream_first =
|
||||
+ panel->prepare_upstream_first;
|
||||
+
|
||||
drm_bridge_add(&panel_bridge->bridge);
|
||||
|
||||
return &panel_bridge->bridge;
|
||||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
|
||||
index 8ea3885cd93f..81ea5e5b272e 100644
|
||||
--- a/include/drm/drm_panel.h
|
||||
+++ b/include/drm/drm_panel.h
|
||||
@@ -196,6 +196,16 @@ struct drm_panel {
|
||||
* Panel entry in registry.
|
||||
*/
|
||||
struct list_head list;
|
||||
+
|
||||
+ /**
|
||||
+ * @prepare_upstream_first:
|
||||
+ *
|
||||
+ * The upstream controller should be prepared first, before the prepare
|
||||
+ * for the panel is called. This is largely required for DSI panels
|
||||
+ * where the DSI host controller should be initialised to LP-11 before
|
||||
+ * the panel is powered up.
|
||||
+ */
|
||||
+ bool prepare_upstream_first;
|
||||
};
|
||||
|
||||
void drm_panel_init(struct drm_panel *panel, struct device *dev,
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 12bde024e868702f0e703990c5ecaf9f8ca674ce Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 11 Mar 2022 17:24:37 +0000
|
||||
Subject: [PATCH 036/726] drm: Include drm_connector.h from drm_panel.h
|
||||
|
||||
drm_panel.h wants to reference enum drm_panel_orientation which is defined
|
||||
in drm_connector.h (despite the name).
|
||||
Include drm_connector.h in drm_panel.h to avoid the rare situation where
|
||||
drm_panel.h is used with drm_connector.h
|
||||
|
||||
https://github.com/raspberrypi/linux/issues/4919
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
include/drm/drm_panel.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
|
||||
index 81ea5e5b272e..451f88efcd1c 100644
|
||||
--- a/include/drm/drm_panel.h
|
||||
+++ b/include/drm/drm_panel.h
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef __DRM_PANEL_H__
|
||||
#define __DRM_PANEL_H__
|
||||
|
||||
+#include <drm/drm_connector.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/list.h>
|
||||
@@ -36,8 +37,6 @@ struct drm_device;
|
||||
struct drm_panel;
|
||||
struct display_timing;
|
||||
|
||||
-enum drm_panel_orientation;
|
||||
-
|
||||
/**
|
||||
* struct drm_panel_funcs - perform operations on a given panel
|
||||
*
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From ea22ce9fff9ba6faaf78bf00196ab24475b91690 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 16 Dec 2021 15:33:43 +0000
|
||||
Subject: [PATCH 037/726] drm/tc358762: Set the pre_enable_upstream_first flag
|
||||
to configure DSI host
|
||||
|
||||
TC358762 wants the DSI host to be prepared before it is powered up, so
|
||||
set the flag to request that the upstream bridges have their
|
||||
pre_enable called first.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/bridge/tc358762.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
|
||||
index 0adc4864beea..9914cfb05b11 100644
|
||||
--- a/drivers/gpu/drm/bridge/tc358762.c
|
||||
+++ b/drivers/gpu/drm/bridge/tc358762.c
|
||||
@@ -229,6 +229,7 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
|
||||
ctx->bridge.funcs = &tc358762_bridge_funcs;
|
||||
ctx->bridge.type = DRM_MODE_CONNECTOR_DPI;
|
||||
ctx->bridge.of_node = dev->of_node;
|
||||
+ ctx->bridge.pre_enable_upstream_first = true;
|
||||
|
||||
drm_bridge_add(&ctx->bridge);
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
From c23b687a74c650faa3177675cb73344e4ce02f16 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 25 Jan 2022 17:28:18 +0000
|
||||
Subject: [PATCH 038/726] drm/vc4: Support zpos on all planes
|
||||
|
||||
Adds the zpos property to all planes, and creates the dlist
|
||||
by placing the fragments in the correct order based on zpos.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 43 +++++++++++++++++++++------------
|
||||
drivers/gpu/drm/vc4/vc4_kms.c | 3 +--
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 22 ++++++++++++++---
|
||||
3 files changed, 48 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 43ba463b6790..38669ea71c4a 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -769,6 +769,8 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
|
||||
bool enable_bg_fill = false;
|
||||
u32 __iomem *dlist_start = vc4->hvs->dlist + vc4_state->mm.start;
|
||||
u32 __iomem *dlist_next = dlist_start;
|
||||
+ unsigned int zpos = 0;
|
||||
+ bool found = false;
|
||||
int idx;
|
||||
|
||||
if (!drm_dev_enter(dev, &idx)) {
|
||||
@@ -782,23 +784,34 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
|
||||
}
|
||||
|
||||
/* Copy all the active planes' dlist contents to the hardware dlist. */
|
||||
- drm_atomic_crtc_for_each_plane(plane, crtc) {
|
||||
- /* Is this the first active plane? */
|
||||
- if (dlist_next == dlist_start) {
|
||||
- /* We need to enable background fill when a plane
|
||||
- * could be alpha blending from the background, i.e.
|
||||
- * where no other plane is underneath. It suffices to
|
||||
- * consider the first active plane here since we set
|
||||
- * needs_bg_fill such that either the first plane
|
||||
- * already needs it or all planes on top blend from
|
||||
- * the first or a lower plane.
|
||||
- */
|
||||
- vc4_plane_state = to_vc4_plane_state(plane->state);
|
||||
- enable_bg_fill = vc4_plane_state->needs_bg_fill;
|
||||
+ do {
|
||||
+ found = false;
|
||||
+
|
||||
+ drm_atomic_crtc_for_each_plane(plane, crtc) {
|
||||
+ if (plane->state->normalized_zpos != zpos)
|
||||
+ continue;
|
||||
+
|
||||
+ /* Is this the first active plane? */
|
||||
+ if (dlist_next == dlist_start) {
|
||||
+ /* We need to enable background fill when a plane
|
||||
+ * could be alpha blending from the background, i.e.
|
||||
+ * where no other plane is underneath. It suffices to
|
||||
+ * consider the first active plane here since we set
|
||||
+ * needs_bg_fill such that either the first plane
|
||||
+ * already needs it or all planes on top blend from
|
||||
+ * the first or a lower plane.
|
||||
+ */
|
||||
+ vc4_plane_state = to_vc4_plane_state(plane->state);
|
||||
+ enable_bg_fill = vc4_plane_state->needs_bg_fill;
|
||||
+ }
|
||||
+
|
||||
+ dlist_next += vc4_plane_write_dlist(plane, dlist_next);
|
||||
+
|
||||
+ found = true;
|
||||
}
|
||||
|
||||
- dlist_next += vc4_plane_write_dlist(plane, dlist_next);
|
||||
- }
|
||||
+ zpos++;
|
||||
+ } while (found);
|
||||
|
||||
writel(SCALER_CTL0_END, dlist_next);
|
||||
dlist_next++;
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
index e52a4cfaebf6..d5b16579fd33 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_kms.c
|
||||
@@ -1066,8 +1066,7 @@ int vc4_kms_load(struct drm_device *dev)
|
||||
dev->mode_config.helper_private = &vc4_mode_config_helpers;
|
||||
dev->mode_config.preferred_depth = 24;
|
||||
dev->mode_config.async_page_flip = true;
|
||||
- if (vc4->firmware_kms)
|
||||
- dev->mode_config.normalize_zpos = true;
|
||||
+ dev->mode_config.normalize_zpos = true;
|
||||
|
||||
ret = vc4_ctm_obj_init(vc4);
|
||||
if (ret)
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index 9ae2feb34461..7c094e9f8218 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -1600,9 +1600,14 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
|
||||
DRM_COLOR_YCBCR_BT709,
|
||||
DRM_COLOR_YCBCR_LIMITED_RANGE);
|
||||
|
||||
+ if (type == DRM_PLANE_TYPE_PRIMARY)
|
||||
+ drm_plane_create_zpos_immutable_property(plane, 0);
|
||||
+
|
||||
return plane;
|
||||
}
|
||||
|
||||
+#define VC4_NUM_OVERLAY_PLANES 16
|
||||
+
|
||||
int vc4_plane_create_additional_planes(struct drm_device *drm)
|
||||
{
|
||||
struct drm_plane *cursor_plane;
|
||||
@@ -1618,24 +1623,35 @@ int vc4_plane_create_additional_planes(struct drm_device *drm)
|
||||
* modest number of planes to expose, that should hopefully
|
||||
* still cover any sane usecase.
|
||||
*/
|
||||
- for (i = 0; i < 16; i++) {
|
||||
+ for (i = 0; i < VC4_NUM_OVERLAY_PLANES; i++) {
|
||||
struct drm_plane *plane =
|
||||
vc4_plane_init(drm, DRM_PLANE_TYPE_OVERLAY,
|
||||
GENMASK(drm->mode_config.num_crtc - 1, 0));
|
||||
|
||||
if (IS_ERR(plane))
|
||||
continue;
|
||||
+
|
||||
+ /* Create zpos property. Max of all the overlays + 1 primary +
|
||||
+ * 1 cursor plane on a crtc.
|
||||
+ */
|
||||
+ drm_plane_create_zpos_property(plane, i + 1, 1,
|
||||
+ VC4_NUM_OVERLAY_PLANES + 1);
|
||||
}
|
||||
|
||||
drm_for_each_crtc(crtc, drm) {
|
||||
/* Set up the legacy cursor after overlay initialization,
|
||||
- * since we overlay planes on the CRTC in the order they were
|
||||
- * initialized.
|
||||
+ * since the zpos fallback is that planes are rendered by plane
|
||||
+ * ID order, and that then puts the cursor on top.
|
||||
*/
|
||||
cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR,
|
||||
drm_crtc_mask(crtc));
|
||||
if (!IS_ERR(cursor_plane)) {
|
||||
crtc->cursor = cursor_plane;
|
||||
+
|
||||
+ drm_plane_create_zpos_property(cursor_plane,
|
||||
+ VC4_NUM_OVERLAY_PLANES + 1,
|
||||
+ 1,
|
||||
+ VC4_NUM_OVERLAY_PLANES + 1);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
From efda6d85d39a846d525536b34bd98977716c9d3c Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 7 Mar 2022 15:19:38 +0000
|
||||
Subject: [PATCH 039/726] drm/vc4: hdmi: Add CSC for BT601/709/2020 limited and
|
||||
full range output
|
||||
|
||||
The HVS always composes in the RGB domain, but there is a colourspace
|
||||
conversion block on the output to allow for sending YCbCr over the
|
||||
HDMI interface.
|
||||
The colourspace on that link is configurable via the "Colorspace"
|
||||
property on the connector, and that updates the infoframes. There
|
||||
is also selection of limited or full range based on the mode selected
|
||||
or an override.
|
||||
|
||||
Add code to update the CSC as well so that the metadata matches the
|
||||
image data.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 196 ++++++++++++++++++++++++---------
|
||||
1 file changed, 145 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index e9cb32d3b0d5..431f901068a0 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -158,8 +158,8 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
|
||||
return clock > HDMI_14_MAX_TMDS_CLK;
|
||||
}
|
||||
|
||||
-static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi,
|
||||
- const struct drm_display_mode *mode)
|
||||
+static bool vc4_hdmi_is_full_range(struct vc4_hdmi *vc4_hdmi,
|
||||
+ const struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_display_info *display = &vc4_hdmi->connector.display_info;
|
||||
|
||||
@@ -901,7 +901,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
|
||||
|
||||
drm_hdmi_avi_infoframe_quant_range(&frame.avi,
|
||||
connector, mode,
|
||||
- vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode) ?
|
||||
+ vc4_hdmi_is_full_range(vc4_hdmi, mode) ?
|
||||
HDMI_QUANTIZATION_RANGE_FULL :
|
||||
HDMI_QUANTIZATION_RANGE_LIMITED);
|
||||
drm_hdmi_avi_infoframe_colorimetry(&frame.avi, cstate);
|
||||
@@ -1154,7 +1154,7 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
|
||||
csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
|
||||
VC4_HD_CSC_CTL_ORDER);
|
||||
|
||||
- if (!vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode)) {
|
||||
+ if (!vc4_hdmi_is_full_range(vc4_hdmi, mode)) {
|
||||
/* CEA VICs other than #1 requre limited range RGB
|
||||
* output unless overridden by an AVI infoframe.
|
||||
* Apply a colorspace conversion to squash 0-255 down
|
||||
@@ -1193,15 +1193,6 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
|
||||
* [ 0 1 0 0]
|
||||
* [ 0 0 1 0]
|
||||
*
|
||||
- * Matrix is signed 2p13 fixed point, with signed 9p6 offsets
|
||||
- */
|
||||
-static const u16 vc5_hdmi_csc_full_rgb_unity[3][4] = {
|
||||
- { 0x2000, 0x0000, 0x0000, 0x0000 },
|
||||
- { 0x0000, 0x2000, 0x0000, 0x0000 },
|
||||
- { 0x0000, 0x0000, 0x2000, 0x0000 },
|
||||
-};
|
||||
-
|
||||
-/*
|
||||
* CEA VICs other than #1 require limited range RGB output unless
|
||||
* overridden by an AVI infoframe. Apply a colorspace conversion to
|
||||
* squash 0-255 down to 16-235. The matrix here is:
|
||||
@@ -1212,43 +1203,105 @@ static const u16 vc5_hdmi_csc_full_rgb_unity[3][4] = {
|
||||
*
|
||||
* Matrix is signed 2p13 fixed point, with signed 9p6 offsets
|
||||
*/
|
||||
-static const u16 vc5_hdmi_csc_full_rgb_to_limited_rgb[3][4] = {
|
||||
- { 0x1b80, 0x0000, 0x0000, 0x0400 },
|
||||
- { 0x0000, 0x1b80, 0x0000, 0x0400 },
|
||||
- { 0x0000, 0x0000, 0x1b80, 0x0400 },
|
||||
+static const u16 vc5_hdmi_csc_full_rgb_to_rgb[2][3][4] = {
|
||||
+ {
|
||||
+ /* Full range - unity */
|
||||
+ { 0x2000, 0x0000, 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x2000, 0x0000, 0x0000 },
|
||||
+ { 0x0000, 0x0000, 0x2000, 0x0000 },
|
||||
+ }, {
|
||||
+ /* Limited range */
|
||||
+ { 0x1b80, 0x0000, 0x0000, 0x0400 },
|
||||
+ { 0x0000, 0x1b80, 0x0000, 0x0400 },
|
||||
+ { 0x0000, 0x0000, 0x1b80, 0x0400 },
|
||||
+ }
|
||||
};
|
||||
|
||||
/*
|
||||
- * Conversion between Full Range RGB and Full Range YUV422 using the
|
||||
- * BT.709 Colorspace
|
||||
+ * Conversion between Full Range RGB and YUV using the BT.601 Colorspace
|
||||
*
|
||||
+ * Full range
|
||||
+ * [ 0.299000 0.587000 0.114000 0.000000 ]
|
||||
+ * [ -0.168736 -0.331264 0.500000 128.000000 ]
|
||||
+ * [ 0.500000 -0.418688 -0.081312 128.000000 ]
|
||||
*
|
||||
- * [ 0.181906 0.611804 0.061758 16 ]
|
||||
- * [ -0.100268 -0.337232 0.437500 128 ]
|
||||
- * [ 0.437500 -0.397386 -0.040114 128 ]
|
||||
+ * Limited range
|
||||
+ * [ 0.255785 0.502160 0.097523 16.000000 ]
|
||||
+ * [ -0.147644 -0.289856 0.437500 128.000000 ]
|
||||
+ * [ 0.437500 -0.366352 -0.071148 128.000000 ]
|
||||
*
|
||||
* Matrix is signed 2p13 fixed point, with signed 9p6 offsets
|
||||
*/
|
||||
-static const u16 vc5_hdmi_csc_full_rgb_to_limited_yuv422_bt709[3][4] = {
|
||||
- { 0x05d2, 0x1394, 0x01fa, 0x0400 },
|
||||
- { 0xfccc, 0xf536, 0x0e00, 0x2000 },
|
||||
- { 0x0e00, 0xf34a, 0xfeb8, 0x2000 },
|
||||
+static const u16 vc5_hdmi_csc_full_rgb_to_yuv_bt601[2][3][4] = {
|
||||
+ {
|
||||
+ /* Full range */
|
||||
+ { 0x0991, 0x12c9, 0x03a6, 0x0000 },
|
||||
+ { 0xfa9b, 0xf567, 0x1000, 0x2000 },
|
||||
+ { 0x1000, 0xf29b, 0xfd67, 0x2000 },
|
||||
+ }, {
|
||||
+ /* Limited range */
|
||||
+ { 0x082f, 0x1012, 0x031f, 0x0400 },
|
||||
+ { 0xfb48, 0xf6ba, 0x0e00, 0x2000 },
|
||||
+ { 0x0e00, 0xf448, 0xfdba, 0x2000 },
|
||||
+ }
|
||||
};
|
||||
|
||||
/*
|
||||
- * Conversion between Full Range RGB and Full Range YUV444 using the
|
||||
- * BT.709 Colorspace
|
||||
+ * Conversion between Full Range RGB and YUV using the BT.709 Colorspace
|
||||
+ *
|
||||
+ * Full range
|
||||
+ * [ 0.212600 0.715200 0.072200 0.000000 ]
|
||||
+ * [ -0.114572 -0.385428 0.500000 128.000000 ]
|
||||
+ * [ 0.500000 -0.454153 -0.045847 128.000000 ]
|
||||
*
|
||||
- * [ -0.100268 -0.337232 0.437500 128 ]
|
||||
- * [ 0.437500 -0.397386 -0.040114 128 ]
|
||||
- * [ 0.181906 0.611804 0.061758 16 ]
|
||||
+ * Limited range
|
||||
+ * [ 0.181873 0.611831 0.061765 16.000000 ]
|
||||
+ * [ -0.100251 -0.337249 0.437500 128.000000 ]
|
||||
+ * [ 0.437500 -0.397384 -0.040116 128.000000 ]
|
||||
*
|
||||
* Matrix is signed 2p13 fixed point, with signed 9p6 offsets
|
||||
*/
|
||||
-static const u16 vc5_hdmi_csc_full_rgb_to_limited_yuv444_bt709[3][4] = {
|
||||
- { 0xfccc, 0xf536, 0x0e00, 0x2000 },
|
||||
- { 0x0e00, 0xf34a, 0xfeb8, 0x2000 },
|
||||
- { 0x05d2, 0x1394, 0x01fa, 0x0400 },
|
||||
+static const u16 vc5_hdmi_csc_full_rgb_to_yuv_bt709[2][3][4] = {
|
||||
+ {
|
||||
+ /* Full range */
|
||||
+ { 0x06ce, 0x16e3, 0x024f, 0x0000 },
|
||||
+ { 0xfc56, 0xf3ac, 0x1000, 0x2000 },
|
||||
+ { 0x1000, 0xf179, 0xfe89, 0x2000 },
|
||||
+ }, {
|
||||
+ /* Limited range */
|
||||
+ { 0x05d2, 0x1394, 0x01fa, 0x0400 },
|
||||
+ { 0xfccc, 0xf536, 0x0e00, 0x2000 },
|
||||
+ { 0x0e00, 0xf34a, 0xfeb8, 0x2000 },
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Conversion between Full Range RGB and YUV using the BT.2020 Colorspace
|
||||
+ *
|
||||
+ * Full range
|
||||
+ * [ 0.262700 0.678000 0.059300 0.000000 ]
|
||||
+ * [ -0.139630 -0.360370 0.500000 128.000000 ]
|
||||
+ * [ 0.500000 -0.459786 -0.040214 128.000000 ]
|
||||
+ *
|
||||
+ * Limited range
|
||||
+ * [ 0.224732 0.580008 0.050729 16.000000 ]
|
||||
+ * [ -0.122176 -0.315324 0.437500 128.000000 ]
|
||||
+ * [ 0.437500 -0.402312 -0.035188 128.000000 ]
|
||||
+ *
|
||||
+ * Matrix is signed 2p13 fixed point, with signed 9p6 offsets
|
||||
+ */
|
||||
+static const u16 vc5_hdmi_csc_full_rgb_to_yuv_bt2020[2][3][4] = {
|
||||
+ {
|
||||
+ /* Full range */
|
||||
+ { 0x0868, 0x15b2, 0x01e6, 0x0000 },
|
||||
+ { 0xfb89, 0xf479, 0x1000, 0x2000 },
|
||||
+ { 0x1000, 0xf14a, 0xfeb8, 0x2000 },
|
||||
+ }, {
|
||||
+ /* Limited range */
|
||||
+ { 0x0731, 0x128f, 0x01a0, 0x0400 },
|
||||
+ { 0xfc18, 0xf5ea, 0x0e00, 0x2000 },
|
||||
+ { 0x0e00, 0xf321, 0xfee1, 0x2000 },
|
||||
+ }
|
||||
};
|
||||
|
||||
static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi *vc4_hdmi,
|
||||
@@ -1264,6 +1317,20 @@ static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi *vc4_hdmi,
|
||||
HDMI_WRITE(HDMI_CSC_34_33, (coeffs[2][3] << 16) | coeffs[2][2]);
|
||||
}
|
||||
|
||||
+static void vc5_hdmi_set_csc_coeffs_swap(struct vc4_hdmi *vc4_hdmi,
|
||||
+ const u16 coeffs[3][4])
|
||||
+{
|
||||
+ lockdep_assert_held(&vc4_hdmi->hw_lock);
|
||||
+
|
||||
+ /* YUV444 needs the CSC matrices using the channels in a different order */
|
||||
+ HDMI_WRITE(HDMI_CSC_12_11, (coeffs[2][1] << 16) | coeffs[2][0]);
|
||||
+ HDMI_WRITE(HDMI_CSC_14_13, (coeffs[2][3] << 16) | coeffs[2][2]);
|
||||
+ HDMI_WRITE(HDMI_CSC_22_21, (coeffs[0][1] << 16) | coeffs[0][0]);
|
||||
+ HDMI_WRITE(HDMI_CSC_24_23, (coeffs[0][3] << 16) | coeffs[0][2]);
|
||||
+ HDMI_WRITE(HDMI_CSC_32_31, (coeffs[1][1] << 16) | coeffs[1][0]);
|
||||
+ HDMI_WRITE(HDMI_CSC_34_33, (coeffs[1][3] << 16) | coeffs[1][2]);
|
||||
+}
|
||||
+
|
||||
static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
|
||||
struct drm_connector_state *state,
|
||||
const struct drm_display_mode *mode)
|
||||
@@ -1271,6 +1338,8 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
|
||||
struct drm_device *drm = vc4_hdmi->connector.dev;
|
||||
struct vc4_hdmi_connector_state *vc4_state =
|
||||
conn_state_to_vc4_hdmi_conn_state(state);
|
||||
+ unsigned int lim_range = vc4_hdmi_is_full_range(vc4_hdmi, mode) ? 0 : 1;
|
||||
+ const u16 (*csc)[4];
|
||||
unsigned long flags;
|
||||
u32 if_cfg = 0;
|
||||
u32 if_xbar = 0x543210;
|
||||
@@ -1286,31 +1355,56 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
|
||||
|
||||
switch (vc4_state->output_format) {
|
||||
case VC4_HDMI_OUTPUT_YUV444:
|
||||
- vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_limited_yuv444_bt709);
|
||||
- break;
|
||||
-
|
||||
case VC4_HDMI_OUTPUT_YUV422:
|
||||
- csc_ctl |= VC4_SET_FIELD(VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422_STANDARD,
|
||||
- VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422) |
|
||||
- VC5_MT_CP_CSC_CTL_USE_444_TO_422 |
|
||||
- VC5_MT_CP_CSC_CTL_USE_RNG_SUPPRESSION;
|
||||
+ switch (state->colorspace) {
|
||||
+ default:
|
||||
+ case DRM_MODE_COLORIMETRY_NO_DATA:
|
||||
+ case DRM_MODE_COLORIMETRY_BT709_YCC:
|
||||
+ case DRM_MODE_COLORIMETRY_XVYCC_709:
|
||||
+ case DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED:
|
||||
+ case DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT:
|
||||
+ csc = vc5_hdmi_csc_full_rgb_to_yuv_bt709[lim_range];
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_SMPTE_170M_YCC:
|
||||
+ case DRM_MODE_COLORIMETRY_XVYCC_601:
|
||||
+ case DRM_MODE_COLORIMETRY_SYCC_601:
|
||||
+ case DRM_MODE_COLORIMETRY_OPYCC_601:
|
||||
+ case DRM_MODE_COLORIMETRY_BT601_YCC:
|
||||
+ csc = vc5_hdmi_csc_full_rgb_to_yuv_bt601[lim_range];
|
||||
+ break;
|
||||
+ case DRM_MODE_COLORIMETRY_BT2020_CYCC:
|
||||
+ case DRM_MODE_COLORIMETRY_BT2020_YCC:
|
||||
+ case DRM_MODE_COLORIMETRY_BT2020_RGB:
|
||||
+ case DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65:
|
||||
+ case DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER:
|
||||
+ csc = vc5_hdmi_csc_full_rgb_to_yuv_bt2020[lim_range];
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- csc_chan_ctl |= VC4_SET_FIELD(VC5_MT_CP_CHANNEL_CTL_OUTPUT_REMAP_LEGACY_STYLE,
|
||||
- VC5_MT_CP_CHANNEL_CTL_OUTPUT_REMAP);
|
||||
+ if (vc4_state->output_format == VC4_HDMI_OUTPUT_YUV422) {
|
||||
+ csc_ctl |= VC4_SET_FIELD(VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422_STANDARD,
|
||||
+ VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422) |
|
||||
+ VC5_MT_CP_CSC_CTL_USE_444_TO_422 |
|
||||
+ VC5_MT_CP_CSC_CTL_USE_RNG_SUPPRESSION;
|
||||
|
||||
- if_cfg |= VC4_SET_FIELD(VC5_DVP_HT_VEC_INTERFACE_CFG_SEL_422_FORMAT_422_LEGACY,
|
||||
- VC5_DVP_HT_VEC_INTERFACE_CFG_SEL_422);
|
||||
+ csc_chan_ctl |= VC4_SET_FIELD(VC5_MT_CP_CHANNEL_CTL_OUTPUT_REMAP_LEGACY_STYLE,
|
||||
+ VC5_MT_CP_CHANNEL_CTL_OUTPUT_REMAP);
|
||||
+
|
||||
+ if_cfg |= VC4_SET_FIELD(VC5_DVP_HT_VEC_INTERFACE_CFG_SEL_422_FORMAT_422_LEGACY,
|
||||
+ VC5_DVP_HT_VEC_INTERFACE_CFG_SEL_422);
|
||||
+
|
||||
+ vc5_hdmi_set_csc_coeffs(vc4_hdmi, csc);
|
||||
+ } else {
|
||||
+ vc5_hdmi_set_csc_coeffs_swap(vc4_hdmi, csc);
|
||||
+ }
|
||||
|
||||
- vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_limited_yuv422_bt709);
|
||||
break;
|
||||
|
||||
case VC4_HDMI_OUTPUT_RGB:
|
||||
if_xbar = 0x354021;
|
||||
|
||||
- if (!vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode))
|
||||
- vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_limited_rgb);
|
||||
- else
|
||||
- vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_unity);
|
||||
+ vc5_hdmi_set_csc_coeffs(vc4_hdmi,
|
||||
+ vc5_hdmi_csc_full_rgb_to_rgb[lim_range]);
|
||||
break;
|
||||
|
||||
default:
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,219 +0,0 @@
|
|||
From 847c8b5eb735b2ec670508bc554890b9dab4c33d Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Mon, 14 Mar 2022 17:56:10 +0000
|
||||
Subject: [PATCH 040/726] vc4/drm: vc4_plane: Keep fractional source coords
|
||||
inside state
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 2 +-
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 68 ++++++++++++++++-----------------
|
||||
2 files changed, 34 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
index d54182f995ef..3be66ba8ecdd 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -384,7 +384,7 @@ struct vc4_plane_state {
|
||||
|
||||
/* Clipped coordinates of the plane on the display. */
|
||||
int crtc_x, crtc_y, crtc_w, crtc_h;
|
||||
- /* Clipped area being scanned from in the FB. */
|
||||
+ /* Clipped area being scanned from in the FB in u16.16 format */
|
||||
u32 src_x, src_y;
|
||||
|
||||
u32 src_w[2], src_h[2];
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index 7c094e9f8218..66b2fb65bb29 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -183,9 +183,9 @@ static const struct hvs_format *vc4_get_hvs_format(u32 drm_format)
|
||||
|
||||
static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst)
|
||||
{
|
||||
- if (dst == src)
|
||||
+ if (dst == src >> 16)
|
||||
return VC4_SCALING_NONE;
|
||||
- if (3 * dst >= 2 * src)
|
||||
+ if (3 * dst >= 2 * (src >> 16))
|
||||
return VC4_SCALING_PPF;
|
||||
else
|
||||
return VC4_SCALING_TPZ;
|
||||
@@ -394,15 +394,10 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
|
||||
vc4_state->offsets[i] = bo->dma_addr + fb->offsets[i];
|
||||
}
|
||||
|
||||
- /*
|
||||
- * We don't support subpixel source positioning for scaling,
|
||||
- * but fractional coordinates can be generated by clipping
|
||||
- * so just round for now
|
||||
- */
|
||||
- vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16);
|
||||
- vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16);
|
||||
- vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x;
|
||||
- vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y;
|
||||
+ vc4_state->src_x = state->src.x1;
|
||||
+ vc4_state->src_y = state->src.y1;
|
||||
+ vc4_state->src_w[0] = state->src.x2 - vc4_state->src_x;
|
||||
+ vc4_state->src_h[0] = state->src.y2 - vc4_state->src_y;
|
||||
|
||||
vc4_state->crtc_x = state->dst.x1;
|
||||
vc4_state->crtc_y = state->dst.y1;
|
||||
@@ -455,7 +450,7 @@ static void vc4_write_tpz(struct vc4_plane_state *vc4_state, u32 src, u32 dst)
|
||||
{
|
||||
u32 scale, recip;
|
||||
|
||||
- scale = (1 << 16) * src / dst;
|
||||
+ scale = src / dst;
|
||||
|
||||
/* The specs note that while the reciprocal would be defined
|
||||
* as (1<<32)/scale, ~0 is close enough.
|
||||
@@ -501,7 +496,7 @@ static u32 vc4_lbm_size(struct drm_plane_state *state)
|
||||
if (vc4_state->x_scaling[0] == VC4_SCALING_TPZ)
|
||||
pix_per_line = vc4_state->crtc_w;
|
||||
else
|
||||
- pix_per_line = vc4_state->src_w[0];
|
||||
+ pix_per_line = vc4_state->src_w[0] >> 16;
|
||||
|
||||
if (!vc4_state->is_yuv) {
|
||||
if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ)
|
||||
@@ -592,7 +587,8 @@ static void vc4_plane_calc_load(struct drm_plane_state *state)
|
||||
for (i = 0; i < fb->format->num_planes; i++) {
|
||||
/* Even if the bandwidth/plane required for a single frame is
|
||||
*
|
||||
- * vc4_state->src_w[i] * vc4_state->src_h[i] * cpp * vrefresh
|
||||
+ * (vc4_state->src_w[i] >> 16) * (vc4_state->src_h[i] >> 16) *
|
||||
+ * cpp * vrefresh
|
||||
*
|
||||
* when downscaling, we have to read more pixels per line in
|
||||
* the time frame reserved for a single line, so the bandwidth
|
||||
@@ -601,11 +597,11 @@ static void vc4_plane_calc_load(struct drm_plane_state *state)
|
||||
* load by this number. We're likely over-estimating the read
|
||||
* demand, but that's better than under-estimating it.
|
||||
*/
|
||||
- vscale_factor = DIV_ROUND_UP(vc4_state->src_h[i],
|
||||
+ vscale_factor = DIV_ROUND_UP(vc4_state->src_h[i] >> 16,
|
||||
vc4_state->crtc_h);
|
||||
- vc4_state->membus_load += vc4_state->src_w[i] *
|
||||
- vc4_state->src_h[i] * vscale_factor *
|
||||
- fb->format->cpp[i];
|
||||
+ vc4_state->membus_load += (vc4_state->src_w[i] >> 16) *
|
||||
+ (vc4_state->src_h[i] >> 16) *
|
||||
+ vscale_factor * fb->format->cpp[i];
|
||||
vc4_state->hvs_load += vc4_state->crtc_h * vc4_state->crtc_w;
|
||||
}
|
||||
|
||||
@@ -758,7 +754,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
bool mix_plane_alpha;
|
||||
bool covers_screen;
|
||||
u32 scl0, scl1, pitch0;
|
||||
- u32 tiling, src_y;
|
||||
+ u32 tiling, src_x, src_y;
|
||||
+ u32 width, height;
|
||||
u32 hvs_format = format->hvs;
|
||||
unsigned int rotation;
|
||||
int ret, i;
|
||||
@@ -770,6 +767,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ width = vc4_state->src_w[0] >> 16;
|
||||
+ height = vc4_state->src_h[0] >> 16;
|
||||
+
|
||||
/* SCL1 is used for Cb/Cr scaling of planar formats. For RGB
|
||||
* and 4:4:4, scl1 should be set to scl0 so both channels of
|
||||
* the scaler do the same thing. For YUV, the Y plane needs
|
||||
@@ -790,9 +790,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
DRM_MODE_REFLECT_Y);
|
||||
|
||||
/* We must point to the last line when Y reflection is enabled. */
|
||||
- src_y = vc4_state->src_y;
|
||||
+ src_y = vc4_state->src_y >> 16;
|
||||
if (rotation & DRM_MODE_REFLECT_Y)
|
||||
- src_y += vc4_state->src_h[0] - 1;
|
||||
+ src_y += height - 1;
|
||||
+
|
||||
+ src_x = vc4_state->src_x >> 16;
|
||||
|
||||
switch (base_format_mod) {
|
||||
case DRM_FORMAT_MOD_LINEAR:
|
||||
@@ -807,7 +809,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
(i ? v_subsample : 1) *
|
||||
fb->pitches[i];
|
||||
|
||||
- vc4_state->offsets[i] += vc4_state->src_x /
|
||||
+ vc4_state->offsets[i] += src_x /
|
||||
(i ? h_subsample : 1) *
|
||||
fb->format->cpp[i];
|
||||
}
|
||||
@@ -830,7 +832,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
* pitch * tile_h == tile_size * tiles_per_row
|
||||
*/
|
||||
u32 tiles_w = fb->pitches[0] >> (tile_size_shift - tile_h_shift);
|
||||
- u32 tiles_l = vc4_state->src_x >> tile_w_shift;
|
||||
+ u32 tiles_l = src_x >> tile_w_shift;
|
||||
u32 tiles_r = tiles_w - tiles_l;
|
||||
u32 tiles_t = src_y >> tile_h_shift;
|
||||
/* Intra-tile offsets, which modify the base address (the
|
||||
@@ -840,7 +842,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
u32 tile_y = (src_y >> 4) & 1;
|
||||
u32 subtile_y = (src_y >> 2) & 3;
|
||||
u32 utile_y = src_y & 3;
|
||||
- u32 x_off = vc4_state->src_x & tile_w_mask;
|
||||
+ u32 x_off = src_x & tile_w_mask;
|
||||
u32 y_off = src_y & tile_h_mask;
|
||||
|
||||
/* When Y reflection is requested we must set the
|
||||
@@ -936,7 +938,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
* of the 12-pixels in that 128-bit word is the
|
||||
* first pixel to be used
|
||||
*/
|
||||
- u32 remaining_pixels = vc4_state->src_x % 96;
|
||||
+ u32 remaining_pixels = src_x % 96;
|
||||
u32 aligned = remaining_pixels / 12;
|
||||
u32 last_bits = remaining_pixels % 12;
|
||||
|
||||
@@ -958,12 +960,12 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
return -EINVAL;
|
||||
}
|
||||
pix_per_tile = tile_w / fb->format->cpp[0];
|
||||
- x_off = (vc4_state->src_x % pix_per_tile) /
|
||||
+ x_off = (src_x % pix_per_tile) /
|
||||
(i ? h_subsample : 1) *
|
||||
fb->format->cpp[i];
|
||||
}
|
||||
|
||||
- tile = vc4_state->src_x / pix_per_tile;
|
||||
+ tile = src_x / pix_per_tile;
|
||||
|
||||
vc4_state->offsets[i] += param * tile_w * tile;
|
||||
vc4_state->offsets[i] += src_y /
|
||||
@@ -1024,10 +1026,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
vc4_dlist_write(vc4_state,
|
||||
(mix_plane_alpha ? SCALER_POS2_ALPHA_MIX : 0) |
|
||||
vc4_hvs4_get_alpha_blend_mode(state) |
|
||||
- VC4_SET_FIELD(vc4_state->src_w[0],
|
||||
- SCALER_POS2_WIDTH) |
|
||||
- VC4_SET_FIELD(vc4_state->src_h[0],
|
||||
- SCALER_POS2_HEIGHT));
|
||||
+ VC4_SET_FIELD(width, SCALER_POS2_WIDTH) |
|
||||
+ VC4_SET_FIELD(height, SCALER_POS2_HEIGHT));
|
||||
|
||||
/* Position Word 3: Context. Written by the HVS. */
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
@@ -1085,10 +1085,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
/* Position Word 2: Source Image Size */
|
||||
vc4_state->pos2_offset = vc4_state->dlist_count;
|
||||
vc4_dlist_write(vc4_state,
|
||||
- VC4_SET_FIELD(vc4_state->src_w[0],
|
||||
- SCALER5_POS2_WIDTH) |
|
||||
- VC4_SET_FIELD(vc4_state->src_h[0],
|
||||
- SCALER5_POS2_HEIGHT));
|
||||
+ VC4_SET_FIELD(width, SCALER5_POS2_WIDTH) |
|
||||
+ VC4_SET_FIELD(height, SCALER5_POS2_HEIGHT));
|
||||
|
||||
/* Position Word 3: Context. Written by the HVS. */
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
From c9899158ffc4b9d694f5025be5a28a33ac32b871 Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Fri, 9 Apr 2021 15:00:40 +0100
|
||||
Subject: [PATCH 041/726] vc4/drm: Handle fractional coordinates using the
|
||||
phase field
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 61 ++++++++++++++++++++++++++++++---
|
||||
1 file changed, 56 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index 66b2fb65bb29..db4267aada46 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -464,14 +464,47 @@ static void vc4_write_tpz(struct vc4_plane_state *vc4_state, u32 src, u32 dst)
|
||||
VC4_SET_FIELD(recip, SCALER_TPZ1_RECIP));
|
||||
}
|
||||
|
||||
-static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst)
|
||||
+/* phase magnitude bits */
|
||||
+#define PHASE_BITS 6
|
||||
+
|
||||
+static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst, u32 xy, int channel)
|
||||
{
|
||||
- u32 scale = (1 << 16) * src / dst;
|
||||
+ u32 scale = src / dst;
|
||||
+ s32 offset, offset2;
|
||||
+ s32 phase;
|
||||
+
|
||||
+ /* Start the phase at 1/2 pixel from the 1st pixel at src_x.
|
||||
+ 1/4 pixel for YUV. */
|
||||
+ if (channel) {
|
||||
+ /* the phase is relative to scale_src->x, so shift it for display list's x value */
|
||||
+ offset = (xy & 0x1ffff) >> (16 - PHASE_BITS) >> 1;
|
||||
+ offset += -(1 << PHASE_BITS >> 2);
|
||||
+ } else {
|
||||
+ /* the phase is relative to scale_src->x, so shift it for display list's x value */
|
||||
+ offset = (xy & 0xffff) >> (16 - PHASE_BITS);
|
||||
+ offset += -(1 << PHASE_BITS >> 1);
|
||||
+
|
||||
+ /* This is a kludge to make sure the scaling factors are consitent with YUV's luma scaling.
|
||||
+ we lose 1bit precision because of this. */
|
||||
+ scale &= ~1;
|
||||
+ }
|
||||
+
|
||||
+ /* There may be a also small error introduced by precision of scale.
|
||||
+ Add half of that as a compromise */
|
||||
+ offset2 = src - dst * scale;
|
||||
+ offset2 >>= 16 - PHASE_BITS;
|
||||
+ phase = offset + (offset2 >> 1);
|
||||
+
|
||||
+ /* Ensure +ve values don't touch the sign bit, then truncate negative values */
|
||||
+ if (phase >= 1 << PHASE_BITS)
|
||||
+ phase = (1 << PHASE_BITS) - 1;
|
||||
+
|
||||
+ phase &= SCALER_PPF_IPHASE_MASK;
|
||||
|
||||
vc4_dlist_write(vc4_state,
|
||||
SCALER_PPF_AGC |
|
||||
VC4_SET_FIELD(scale, SCALER_PPF_SCALE) |
|
||||
- VC4_SET_FIELD(0, SCALER_PPF_IPHASE));
|
||||
+ VC4_SET_FIELD(phase, SCALER_PPF_IPHASE));
|
||||
}
|
||||
|
||||
static u32 vc4_lbm_size(struct drm_plane_state *state)
|
||||
@@ -530,13 +563,13 @@ static void vc4_write_scaling_parameters(struct drm_plane_state *state,
|
||||
/* Ch0 H-PPF Word 0: Scaling Parameters */
|
||||
if (vc4_state->x_scaling[channel] == VC4_SCALING_PPF) {
|
||||
vc4_write_ppf(vc4_state,
|
||||
- vc4_state->src_w[channel], vc4_state->crtc_w);
|
||||
+ vc4_state->src_w[channel], vc4_state->crtc_w, vc4_state->src_x, channel);
|
||||
}
|
||||
|
||||
/* Ch0 V-PPF Words 0-1: Scaling Parameters, Context */
|
||||
if (vc4_state->y_scaling[channel] == VC4_SCALING_PPF) {
|
||||
vc4_write_ppf(vc4_state,
|
||||
- vc4_state->src_h[channel], vc4_state->crtc_h);
|
||||
+ vc4_state->src_h[channel], vc4_state->crtc_h, vc4_state->src_y, channel);
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
}
|
||||
|
||||
@@ -984,6 +1017,24 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ /* fetch an extra pixel if we don't actually line up with the left edge. */
|
||||
+ if ((vc4_state->src_x & 0xffff) && vc4_state->src_x < (state->fb->width << 16))
|
||||
+ width++;
|
||||
+
|
||||
+ /* same for the right side */
|
||||
+ if (((vc4_state->src_x + vc4_state->src_w[0]) & 0xffff) &&
|
||||
+ vc4_state->src_x + vc4_state->src_w[0] < (state->fb->width << 16))
|
||||
+ width++;
|
||||
+
|
||||
+ /* now for the top */
|
||||
+ if ((vc4_state->src_y & 0xffff) && vc4_state->src_y < (state->fb->height << 16))
|
||||
+ height++;
|
||||
+
|
||||
+ /* and the bottom */
|
||||
+ if (((vc4_state->src_y + vc4_state->src_h[0]) & 0xffff) &&
|
||||
+ vc4_state->src_y + vc4_state->src_h[0] < (state->fb->height << 16))
|
||||
+ height++;
|
||||
+
|
||||
/* Don't waste cycles mixing with plane alpha if the set alpha
|
||||
* is opaque or there is no per-pixel alpha information.
|
||||
* In any case we use the alpha property value as the fixed alpha.
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
From 043028bfdc55e891bb0ceda95fc2496c8ef5b2cb Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Wed, 26 Jan 2022 15:58:13 +0000
|
||||
Subject: [PATCH 042/726] drm: Add chroma siting properties
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_atomic_state_helper.c | 14 +++++++++
|
||||
drivers/gpu/drm/drm_atomic_uapi.c | 8 +++++
|
||||
drivers/gpu/drm/drm_color_mgmt.c | 36 +++++++++++++++++++++++
|
||||
include/drm/drm_color_mgmt.h | 3 ++
|
||||
include/drm/drm_plane.h | 36 +++++++++++++++++++++++
|
||||
5 files changed, 97 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
|
||||
index bf31b9d92094..b1288aae847a 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
|
||||
@@ -267,6 +267,20 @@ void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state,
|
||||
plane_state->color_range = val;
|
||||
}
|
||||
|
||||
+ if (plane->chroma_siting_h_property) {
|
||||
+ if (!drm_object_property_get_default_value(&plane->base,
|
||||
+ plane->chroma_siting_h_property,
|
||||
+ &val))
|
||||
+ plane_state->chroma_siting_h = val;
|
||||
+ }
|
||||
+
|
||||
+ if (plane->chroma_siting_v_property) {
|
||||
+ if (!drm_object_property_get_default_value(&plane->base,
|
||||
+ plane->chroma_siting_v_property,
|
||||
+ &val))
|
||||
+ plane_state->chroma_siting_v = val;
|
||||
+ }
|
||||
+
|
||||
if (plane->zpos_property) {
|
||||
if (!drm_object_property_get_default_value(&plane->base,
|
||||
plane->zpos_property,
|
||||
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
index 79730fa1dd8e..4531f7441578 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
@@ -562,6 +562,10 @@ static int drm_atomic_plane_set_property(struct drm_plane *plane,
|
||||
state->color_encoding = val;
|
||||
} else if (property == plane->color_range_property) {
|
||||
state->color_range = val;
|
||||
+ } else if (property == plane->chroma_siting_h_property) {
|
||||
+ state->chroma_siting_h = val;
|
||||
+ } else if (property == plane->chroma_siting_v_property) {
|
||||
+ state->chroma_siting_v = val;
|
||||
} else if (property == config->prop_fb_damage_clips) {
|
||||
ret = drm_atomic_replace_property_blob_from_id(dev,
|
||||
&state->fb_damage_clips,
|
||||
@@ -628,6 +632,10 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
|
||||
*val = state->color_encoding;
|
||||
} else if (property == plane->color_range_property) {
|
||||
*val = state->color_range;
|
||||
+ } else if (property == plane->chroma_siting_h_property) {
|
||||
+ *val = state->chroma_siting_h;
|
||||
+ } else if (property == plane->chroma_siting_v_property) {
|
||||
+ *val = state->chroma_siting_v;
|
||||
} else if (property == config->prop_fb_damage_clips) {
|
||||
*val = (state->fb_damage_clips) ?
|
||||
state->fb_damage_clips->base.id : 0;
|
||||
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
|
||||
index 996f12438016..973c6aeff8a1 100644
|
||||
--- a/drivers/gpu/drm/drm_color_mgmt.c
|
||||
+++ b/drivers/gpu/drm/drm_color_mgmt.c
|
||||
@@ -590,6 +590,42 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
|
||||
}
|
||||
EXPORT_SYMBOL(drm_plane_create_color_properties);
|
||||
|
||||
+/**
|
||||
+ * drm_plane_create_chroma_siting_properties - chroma siting related plane properties
|
||||
+ * @plane: plane object
|
||||
+ *
|
||||
+ * Create and attach plane specific CHROMA_SITING
|
||||
+ * properties to @plane.
|
||||
+ */
|
||||
+int drm_plane_create_chroma_siting_properties(struct drm_plane *plane,
|
||||
+ int32_t default_chroma_siting_h,
|
||||
+ int32_t default_chroma_siting_v)
|
||||
+{
|
||||
+ struct drm_device *dev = plane->dev;
|
||||
+ struct drm_property *prop;
|
||||
+
|
||||
+ prop = drm_property_create_range(dev, 0, "CHROMA_SITING_H",
|
||||
+ 0, 1<<16);
|
||||
+ if (!prop)
|
||||
+ return -ENOMEM;
|
||||
+ plane->chroma_siting_h_property = prop;
|
||||
+ drm_object_attach_property(&plane->base, prop, default_chroma_siting_h);
|
||||
+
|
||||
+ prop = drm_property_create_range(dev, 0, "CHROMA_SITING_V",
|
||||
+ 0, 1<<16);
|
||||
+ if (!prop)
|
||||
+ return -ENOMEM;
|
||||
+ plane->chroma_siting_v_property = prop;
|
||||
+ drm_object_attach_property(&plane->base, prop, default_chroma_siting_v);
|
||||
+
|
||||
+ if (plane->state) {
|
||||
+ plane->state->chroma_siting_h = default_chroma_siting_h;
|
||||
+ plane->state->chroma_siting_v = default_chroma_siting_v;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+EXPORT_SYMBOL(drm_plane_create_chroma_siting_properties);
|
||||
+
|
||||
/**
|
||||
* drm_color_lut_check - check validity of lookup table
|
||||
* @lut: property blob containing LUT to check
|
||||
diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
|
||||
index 81c298488b0c..e2573d0dfb8c 100644
|
||||
--- a/include/drm/drm_color_mgmt.h
|
||||
+++ b/include/drm/drm_color_mgmt.h
|
||||
@@ -93,6 +93,9 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
|
||||
enum drm_color_encoding default_encoding,
|
||||
enum drm_color_range default_range);
|
||||
|
||||
+int drm_plane_create_chroma_siting_properties(struct drm_plane *plane,
|
||||
+ int32_t default_chroma_siting_h, int32_t default_chroma_siting_v);
|
||||
+
|
||||
/**
|
||||
* enum drm_color_lut_tests - hw-specific LUT tests to perform
|
||||
*
|
||||
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
|
||||
index 447e664e49d5..fba2bb6731df 100644
|
||||
--- a/include/drm/drm_plane.h
|
||||
+++ b/include/drm/drm_plane.h
|
||||
@@ -177,6 +177,24 @@ struct drm_plane_state {
|
||||
*/
|
||||
enum drm_color_range color_range;
|
||||
|
||||
+ /**
|
||||
+ * @chroma_siting_h:
|
||||
+ *
|
||||
+ * Location of chroma samples horizontally compared to luma
|
||||
+ * 0 means chroma is sited with left luma
|
||||
+ * 0x8000 is interstitial. 0x10000 is sited with right luma
|
||||
+ */
|
||||
+ int32_t chroma_siting_h;
|
||||
+
|
||||
+ /**
|
||||
+ * @chroma_siting_v:
|
||||
+ *
|
||||
+ * Location of chroma samples vertically compared to luma
|
||||
+ * 0 means chroma is sited with top luma
|
||||
+ * 0x8000 is interstitial. 0x10000 is sited with bottom luma
|
||||
+ */
|
||||
+ int32_t chroma_siting_v;
|
||||
+
|
||||
/**
|
||||
* @fb_damage_clips:
|
||||
*
|
||||
@@ -748,6 +766,24 @@ struct drm_plane {
|
||||
* scaling.
|
||||
*/
|
||||
struct drm_property *scaling_filter_property;
|
||||
+
|
||||
+ /**
|
||||
+ * @chroma_siting_h_property:
|
||||
+ *
|
||||
+ * Optional "CHROMA_SITING_H" property for specifying
|
||||
+ * chroma siting for YUV formats.
|
||||
+ * See drm_plane_create_chroma_siting_properties().
|
||||
+ */
|
||||
+ struct drm_property *chroma_siting_h_property;
|
||||
+
|
||||
+ /**
|
||||
+ * @chroma_siting_v_property:
|
||||
+ *
|
||||
+ * Optional "CHROMA_SITING_V" property for specifying
|
||||
+ * chroma siting for YUV formats.
|
||||
+ * See drm_plane_create_chroma_siting_properties().
|
||||
+ */
|
||||
+ struct drm_property *chroma_siting_v_property;
|
||||
};
|
||||
|
||||
#define obj_to_plane(x) container_of(x, struct drm_plane, base)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
From 8f787f4cc22b104ce67429f3b981dcb319fd44bd Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Thu, 27 Jan 2022 15:32:04 +0000
|
||||
Subject: [PATCH 043/726] vc4/drm:plane: Make use of chroma siting parameter
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index db4267aada46..646abd145800 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -467,17 +467,18 @@ static void vc4_write_tpz(struct vc4_plane_state *vc4_state, u32 src, u32 dst)
|
||||
/* phase magnitude bits */
|
||||
#define PHASE_BITS 6
|
||||
|
||||
-static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst, u32 xy, int channel)
|
||||
+static void vc4_write_ppf(struct vc4_plane_state *vc4_state, u32 src, u32 dst, u32 xy, int channel, int chroma_offset)
|
||||
{
|
||||
u32 scale = src / dst;
|
||||
s32 offset, offset2;
|
||||
s32 phase;
|
||||
|
||||
/* Start the phase at 1/2 pixel from the 1st pixel at src_x.
|
||||
- 1/4 pixel for YUV. */
|
||||
+ 1/4 pixel for YUV, plus the offset for chroma siting */
|
||||
if (channel) {
|
||||
/* the phase is relative to scale_src->x, so shift it for display list's x value */
|
||||
offset = (xy & 0x1ffff) >> (16 - PHASE_BITS) >> 1;
|
||||
+ offset -= chroma_offset >> (17 - PHASE_BITS);
|
||||
offset += -(1 << PHASE_BITS >> 2);
|
||||
} else {
|
||||
/* the phase is relative to scale_src->x, so shift it for display list's x value */
|
||||
@@ -563,13 +564,15 @@ static void vc4_write_scaling_parameters(struct drm_plane_state *state,
|
||||
/* Ch0 H-PPF Word 0: Scaling Parameters */
|
||||
if (vc4_state->x_scaling[channel] == VC4_SCALING_PPF) {
|
||||
vc4_write_ppf(vc4_state,
|
||||
- vc4_state->src_w[channel], vc4_state->crtc_w, vc4_state->src_x, channel);
|
||||
+ vc4_state->src_w[channel], vc4_state->crtc_w, vc4_state->src_x, channel,
|
||||
+ state->chroma_siting_h);
|
||||
}
|
||||
|
||||
/* Ch0 V-PPF Words 0-1: Scaling Parameters, Context */
|
||||
if (vc4_state->y_scaling[channel] == VC4_SCALING_PPF) {
|
||||
vc4_write_ppf(vc4_state,
|
||||
- vc4_state->src_h[channel], vc4_state->crtc_h, vc4_state->src_y, channel);
|
||||
+ vc4_state->src_h[channel], vc4_state->crtc_h, vc4_state->src_y, channel,
|
||||
+ state->chroma_siting_v);
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
}
|
||||
|
||||
@@ -1649,6 +1652,8 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
|
||||
DRM_COLOR_YCBCR_BT709,
|
||||
DRM_COLOR_YCBCR_LIMITED_RANGE);
|
||||
|
||||
+ drm_plane_create_chroma_siting_properties(plane, 0, 0);
|
||||
+
|
||||
if (type == DRM_PLANE_TYPE_PRIMARY)
|
||||
drm_plane_create_zpos_immutable_property(plane, 0);
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
From 3c5802ee9bdae3d3fc37b0da8a437cf565ad264a Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 1 Apr 2022 11:31:38 +0100
|
||||
Subject: [PATCH 044/726] drm/vc4: Force trigger of dlist update on margins
|
||||
change
|
||||
|
||||
When the margins are changed, the dlist needs to be regenerated
|
||||
with the changed updated dest regions for each of the planes.
|
||||
|
||||
Setting the zpos_changed flag is sufficient to trigger that
|
||||
without doing a full modeset, therefore set it should the
|
||||
margins be changed.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_crtc.c | 14 ++++++++++----
|
||||
drivers/gpu/drm/vc4/vc4_drv.h | 7 +------
|
||||
2 files changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
index 0b16fb5acd7d..97b1107a30bb 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
||||
@@ -757,10 +757,16 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
if (conn_state->crtc != crtc)
|
||||
continue;
|
||||
|
||||
- vc4_state->margins.left = conn_state->tv.margins.left;
|
||||
- vc4_state->margins.right = conn_state->tv.margins.right;
|
||||
- vc4_state->margins.top = conn_state->tv.margins.top;
|
||||
- vc4_state->margins.bottom = conn_state->tv.margins.bottom;
|
||||
+ if (memcmp(&vc4_state->margins, &conn_state->tv.margins,
|
||||
+ sizeof(vc4_state->margins))) {
|
||||
+ memcpy(&vc4_state->margins, &conn_state->tv.margins,
|
||||
+ sizeof(vc4_state->margins));
|
||||
+
|
||||
+ /* Need to force the dlist entries for all planes to be
|
||||
+ * updated so that the dest rectangles are changed.
|
||||
+ */
|
||||
+ crtc_state->zpos_changed = true;
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
index 3be66ba8ecdd..a3d058d3c788 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
||||
@@ -581,12 +581,7 @@ struct vc4_crtc_state {
|
||||
bool txp_armed;
|
||||
unsigned int assigned_channel;
|
||||
|
||||
- struct {
|
||||
- unsigned int left;
|
||||
- unsigned int right;
|
||||
- unsigned int top;
|
||||
- unsigned int bottom;
|
||||
- } margins;
|
||||
+ struct drm_connector_tv_margins margins;
|
||||
|
||||
unsigned long hvs_load;
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
From 5af9f6b0895e91d8a0c6f003d98723816a88ac7a Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Date: Fri, 23 Oct 2020 14:39:23 +0200
|
||||
Subject: [PATCH 045/726] drm/atomic-helpers: remove legacy_cursor_update hacks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The stuff never really worked, and leads to lots of fun because it
|
||||
out-of-order frees atomic states. Which upsets KASAN, among other
|
||||
things.
|
||||
|
||||
For async updates we now have a more solid solution with the
|
||||
->atomic_async_check and ->atomic_async_commit hooks. Support for that
|
||||
for msm and vc4 landed. nouveau and i915 have their own commit
|
||||
routines, doing something similar.
|
||||
|
||||
For everyone else it's probably better to remove the use-after-free
|
||||
bug, and encourage folks to use the async support instead. The
|
||||
affected drivers which register a legacy cursor plane and don't either
|
||||
use the new async stuff or their own commit routine are: amdgpu,
|
||||
atmel, mediatek, qxl, rockchip, sti, sun4i, tegra, virtio, and vmwgfx.
|
||||
|
||||
Inspired by an amdgpu bug report.
|
||||
|
||||
v2: Drop RFC, I think with amdgpu converted over to use
|
||||
atomic_async_check/commit done in
|
||||
|
||||
commit 674e78acae0dfb4beb56132e41cbae5b60f7d662
|
||||
Author: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
|
||||
Date: Wed Dec 5 14:59:07 2018 -0500
|
||||
|
||||
drm/amd/display: Add fast path for cursor plane updates
|
||||
|
||||
we don't have any driver anymore where we have userspace expecting
|
||||
solid legacy cursor support _and_ they are using the atomic helpers in
|
||||
their fully glory. So we can retire this.
|
||||
|
||||
v3: Paper over msm and i915 regression. The complete_all is the only
|
||||
thing missing afaict.
|
||||
|
||||
v4: Rebased on recent kernel, added extra link for vc4 bug.
|
||||
|
||||
Link: https://bugzilla.kernel.org/show_bug.cgi?id=199425
|
||||
Link: https://lore.kernel.org/all/20220221134155.125447-9-maxime@cerno.tech/
|
||||
Cc: mikita.lipski@amd.com
|
||||
Cc: Michel Dänzer <michel@daenzer.net>
|
||||
Cc: harry.wentland@amd.com
|
||||
Cc: Rob Clark <robdclark@gmail.com>
|
||||
Cc: "Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>
|
||||
Tested-by: Maxime Ripard <maxime@cerno.tech>
|
||||
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/drm_atomic_helper.c | 13 -------------
|
||||
drivers/gpu/drm/i915/display/intel_display.c | 13 +++++++++++++
|
||||
drivers/gpu/drm/msm/msm_atomic.c | 2 ++
|
||||
3 files changed, 15 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
|
||||
index f3e59236a8ee..e8d77ab10389 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic_helper.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic_helper.c
|
||||
@@ -1608,13 +1608,6 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
|
||||
int i, ret;
|
||||
unsigned int crtc_mask = 0;
|
||||
|
||||
- /*
|
||||
- * Legacy cursor ioctls are completely unsynced, and userspace
|
||||
- * relies on that (by doing tons of cursor updates).
|
||||
- */
|
||||
- if (old_state->legacy_cursor_update)
|
||||
- return;
|
||||
-
|
||||
for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) {
|
||||
if (!new_crtc_state->active)
|
||||
continue;
|
||||
@@ -2265,12 +2258,6 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
|
||||
continue;
|
||||
}
|
||||
|
||||
- /* Legacy cursor updates are fully unsynced. */
|
||||
- if (state->legacy_cursor_update) {
|
||||
- complete_all(&commit->flip_done);
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
if (!new_crtc_state->event) {
|
||||
commit->event = kzalloc(sizeof(*commit->event),
|
||||
GFP_KERNEL);
|
||||
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
|
||||
index 4bbb84847ecb..465e607f9529 100644
|
||||
--- a/drivers/gpu/drm/i915/display/intel_display.c
|
||||
+++ b/drivers/gpu/drm/i915/display/intel_display.c
|
||||
@@ -7743,6 +7743,19 @@ static int intel_atomic_commit(struct drm_device *dev,
|
||||
state->base.legacy_cursor_update = false;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * FIXME: Cut over to (async) commit helpers instead of hand-rolling
|
||||
+ * everything.
|
||||
+ */
|
||||
+ if (state->base.legacy_cursor_update) {
|
||||
+ struct intel_crtc_state *new_crtc_state;
|
||||
+ struct intel_crtc *crtc;
|
||||
+ int i;
|
||||
+
|
||||
+ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i)
|
||||
+ complete_all(&new_crtc_state->uapi.commit->flip_done);
|
||||
+ }
|
||||
+
|
||||
ret = intel_atomic_prepare_commit(state);
|
||||
if (ret) {
|
||||
drm_dbg_atomic(&dev_priv->drm,
|
||||
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
|
||||
index 1686fbb611fd..b3cfabebe5d6 100644
|
||||
--- a/drivers/gpu/drm/msm/msm_atomic.c
|
||||
+++ b/drivers/gpu/drm/msm/msm_atomic.c
|
||||
@@ -222,6 +222,8 @@ void msm_atomic_commit_tail(struct drm_atomic_state *state)
|
||||
/* async updates are limited to single-crtc updates: */
|
||||
WARN_ON(crtc_mask != drm_crtc_mask(async_crtc));
|
||||
|
||||
+ complete_all(&async_crtc->state->commit->flip_done);
|
||||
+
|
||||
/*
|
||||
* Start timer if we don't already have an update pending
|
||||
* on this crtc:
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
From 98efbd5cb44f8927240c01507055050405455428 Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Thu, 5 May 2022 18:50:04 +0100
|
||||
Subject: [PATCH 046/726] drm/vc4_hdmi: Force a modeset when Broadcast RGB
|
||||
setting changes
|
||||
|
||||
Without this the change is not visible until the next modeset
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
index 431f901068a0..3546c7af0329 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
||||
@@ -536,14 +536,17 @@ static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector,
|
||||
{
|
||||
struct drm_connector_state *old_state =
|
||||
drm_atomic_get_old_connector_state(state, connector);
|
||||
+ struct vc4_hdmi_connector_state *old_vc4_state = conn_state_to_vc4_hdmi_conn_state(old_state);
|
||||
struct drm_connector_state *new_state =
|
||||
drm_atomic_get_new_connector_state(state, connector);
|
||||
+ struct vc4_hdmi_connector_state *new_vc4_state = conn_state_to_vc4_hdmi_conn_state(new_state);
|
||||
struct drm_crtc *crtc = new_state->crtc;
|
||||
|
||||
if (!crtc)
|
||||
return 0;
|
||||
|
||||
if (old_state->colorspace != new_state->colorspace ||
|
||||
+ old_vc4_state->broadcast_rgb != new_vc4_state->broadcast_rgb ||
|
||||
!drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) {
|
||||
struct drm_crtc_state *crtc_state;
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
From b2d534e6c8f1733db9b3052cabeb3127fcd65516 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 1 Apr 2022 17:10:37 +0100
|
||||
Subject: [PATCH 047/726] drm/atomic: If margins are updated, update all
|
||||
planes.
|
||||
|
||||
Margins may be implemented by scaling the planes, but as there
|
||||
is no way of intercepting the set_property for a standard property,
|
||||
and all planes are checked in drm_atomic_check_only before the
|
||||
connectors, there's now way to add the planes into the state
|
||||
from the driver.
|
||||
|
||||
If the margin properties change, add all corresponding planes to
|
||||
the state.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_atomic_uapi.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
index 4531f7441578..f6856df35093 100644
|
||||
--- a/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
|
||||
@@ -679,6 +679,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_mode_config *config = &dev->mode_config;
|
||||
+ bool margins_updated = false;
|
||||
bool replaced = false;
|
||||
int ret;
|
||||
|
||||
@@ -698,12 +699,16 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
|
||||
state->tv.subconnector = val;
|
||||
} else if (property == config->tv_left_margin_property) {
|
||||
state->tv.margins.left = val;
|
||||
+ margins_updated = true;
|
||||
} else if (property == config->tv_right_margin_property) {
|
||||
state->tv.margins.right = val;
|
||||
+ margins_updated = true;
|
||||
} else if (property == config->tv_top_margin_property) {
|
||||
state->tv.margins.top = val;
|
||||
+ margins_updated = true;
|
||||
} else if (property == config->tv_bottom_margin_property) {
|
||||
state->tv.margins.bottom = val;
|
||||
+ margins_updated = true;
|
||||
} else if (property == config->tv_mode_property) {
|
||||
state->tv.mode = val;
|
||||
} else if (property == config->tv_brightness_property) {
|
||||
@@ -784,6 +789,12 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ if (margins_updated && state->crtc) {
|
||||
+ ret = drm_atomic_add_affected_planes(state->state, state->crtc);
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
From 087849e24ec3f07c88e49e8d6e86d93344ba5d5b Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 6 Dec 2021 16:32:10 +0100
|
||||
Subject: [PATCH 048/726] drm/vc4: hvs: Ignore atomic_flush if we're disabled
|
||||
|
||||
atomic_flush will be called for each CRTC even if they aren't enabled.
|
||||
|
||||
The whole code we have there will thus run without a properly affected
|
||||
channel, which can then result in all sorts of weird behaviour.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 38669ea71c4a..67effc334715 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -778,6 +778,9 @@ void vc4_hvs_atomic_flush(struct drm_crtc *crtc,
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
|
||||
+ return;
|
||||
+
|
||||
if (debug_dump_regs) {
|
||||
DRM_INFO("CRTC %d HVS before:\n", drm_crtc_index(crtc));
|
||||
vc4_hvs_dump_state(hvs);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
From 9180b45a1ca2c7ad20528761ceb635b143147dc7 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 3 Jun 2022 16:49:09 +0100
|
||||
Subject: [PATCH 049/726] drm: vc4: 0 is a valid value for pixel_order_hvs5, so
|
||||
fix conditionals
|
||||
|
||||
vc4_plane_mode_set for HVS5 was using pixel_order unless pixel_order_hvs5
|
||||
was non-zero, except 0 is a valid value for the pixel_order.
|
||||
|
||||
Specify pixel_order_hvs5 for all formats and remove the conditional.
|
||||
|
||||
Reported-by: vrazzer <teamvraz@pipmail.net>
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 20 ++++++++++++++------
|
||||
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index 646abd145800..a21898d885c7 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -65,11 +65,13 @@ static const struct hvs_format {
|
||||
.drm = DRM_FORMAT_RGB565,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGB565,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XRGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XRGB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_BGR565,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGB565,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XBGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XBGR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_ARGB1555,
|
||||
@@ -87,56 +89,67 @@ static const struct hvs_format {
|
||||
.drm = DRM_FORMAT_RGB888,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGB888,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XRGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XRGB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_BGR888,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGB888,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XBGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XBGR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_YUV422,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_3PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_YVU422,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_3PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCRCB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_YUV420,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_YVU420,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCRCB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_NV12,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_NV21,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCRCB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_NV16,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_NV61,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCRCB,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_P030,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_10BIT,
|
||||
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
{
|
||||
@@ -1087,15 +1100,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
|
||||
vc4_dlist_write(vc4_state, 0xc0c0c0c0);
|
||||
|
||||
} else {
|
||||
- u32 hvs_pixel_order = format->pixel_order;
|
||||
-
|
||||
- if (format->pixel_order_hvs5)
|
||||
- hvs_pixel_order = format->pixel_order_hvs5;
|
||||
-
|
||||
/* Control word */
|
||||
vc4_dlist_write(vc4_state,
|
||||
SCALER_CTL0_VALID |
|
||||
- (hvs_pixel_order << SCALER_CTL0_ORDER_SHIFT) |
|
||||
+ (format->pixel_order_hvs5 << SCALER_CTL0_ORDER_SHIFT) |
|
||||
(hvs_format << SCALER_CTL0_PIXEL_FORMAT_SHIFT) |
|
||||
VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) |
|
||||
(vc4_state->is_unity ?
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
From a68733629115ff2646dc689870b46a640ec45237 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 6 Jun 2022 12:23:28 +0100
|
||||
Subject: [PATCH 050/726] drm: vc4: Omit pixel_order from the hvs_format for
|
||||
hvs5 only formats
|
||||
|
||||
pixel_order is used for the earlier versions of the HVS, so is
|
||||
redundant on the 10:10:10:2 and 10bit YUV formats that are only
|
||||
supported on HVS5.
|
||||
Remove the assignment from the table to avoid confusion.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index a21898d885c7..cdd1dd6a7e48 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -148,35 +148,30 @@ static const struct hvs_format {
|
||||
{
|
||||
.drm = DRM_FORMAT_P030,
|
||||
.hvs = HVS_PIXEL_FORMAT_YCBCR_10BIT,
|
||||
- .pixel_order = HVS_PIXEL_ORDER_XYCBCR,
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_XYCBCR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_XRGB2101010,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
- .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_ARGB2101010,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
- .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_ABGR2101010,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
- .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
{
|
||||
.drm = DRM_FORMAT_XBGR2101010,
|
||||
.hvs = HVS_PIXEL_FORMAT_RGBA1010102,
|
||||
- .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
From 54542cae34307b4c8d1519f249ce8d80202cdbd1 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Fri, 3 Jun 2022 16:57:04 +0100
|
||||
Subject: [PATCH 051/726] drm: vc4: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats
|
||||
|
||||
The hardware supports the 332 8bpp and 4:4:4:4 16bpp formats,
|
||||
but the table of supported formats didn't include them.
|
||||
Add them in.
|
||||
|
||||
In theory they are supported for T-format as well as linear,
|
||||
but without a way to test them just add them as linear for now.
|
||||
|
||||
Suggested-by: vrazzer <teamvraz@pipmail.net>
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_plane.c | 70 +++++++++++++++++++++++++++++++++
|
||||
1 file changed, 70 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
index cdd1dd6a7e48..6432055454ac 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
||||
@@ -175,6 +175,66 @@ static const struct hvs_format {
|
||||
.pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
.hvs5_only = true,
|
||||
},
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_RGB332,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGB332,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_BGR233,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGB332,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_XRGB4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_ARGB4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ABGR,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ARGB,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_XBGR4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_ABGR4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_ARGB,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_ABGR,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_BGRX4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_RGBA,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_BGRA,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_BGRA4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_RGBA,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_BGRA,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_RGBX4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_BGRA,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_RGBA,
|
||||
+ },
|
||||
+ {
|
||||
+ .drm = DRM_FORMAT_RGBA4444,
|
||||
+ .hvs = HVS_PIXEL_FORMAT_RGBA4444,
|
||||
+ .pixel_order = HVS_PIXEL_ORDER_BGRA,
|
||||
+ .pixel_order_hvs5 = HVS_PIXEL_ORDER_RGBA,
|
||||
+ },
|
||||
};
|
||||
|
||||
static const struct hvs_format *vc4_get_hvs_format(u32 drm_format)
|
||||
@@ -1575,6 +1635,16 @@ static bool vc4_format_mod_supported(struct drm_plane *plane,
|
||||
case DRM_FORMAT_BGRX1010102:
|
||||
case DRM_FORMAT_RGBA1010102:
|
||||
case DRM_FORMAT_BGRA1010102:
|
||||
+ case DRM_FORMAT_XRGB4444:
|
||||
+ case DRM_FORMAT_ARGB4444:
|
||||
+ case DRM_FORMAT_XBGR4444:
|
||||
+ case DRM_FORMAT_ABGR4444:
|
||||
+ case DRM_FORMAT_RGBX4444:
|
||||
+ case DRM_FORMAT_RGBA4444:
|
||||
+ case DRM_FORMAT_BGRX4444:
|
||||
+ case DRM_FORMAT_BGRA4444:
|
||||
+ case DRM_FORMAT_RGB332:
|
||||
+ case DRM_FORMAT_BGR233:
|
||||
case DRM_FORMAT_YUV422:
|
||||
case DRM_FORMAT_YVU422:
|
||||
case DRM_FORMAT_YUV420:
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 939749ba601ba56e139706e1cd5285c72e89c8da Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Mon, 6 Jun 2022 14:53:56 +0100
|
||||
Subject: [PATCH 052/726] drm: vc4: Add comments for which HVS_PIXEL_ORDER_xxx
|
||||
defines apply
|
||||
|
||||
The HVS_PIXEL_ORDER_xxx defines apply to specific HVS_PIXEL_FORMAT_xxx
|
||||
modes, so add comments to make this obvious.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_regs.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
index e162d3f3bd3c..098173290411 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_regs.h
|
||||
@@ -870,16 +870,19 @@ enum hvs_pixel_format {
|
||||
/* Note: the LSB is the rightmost character shown. Only valid for
|
||||
* HVS_PIXEL_FORMAT_RGB8888, not RGB888.
|
||||
*/
|
||||
+/* For modes 332, 4444, 555, 5551, 6666, 8888, 10:10:10:2 */
|
||||
#define HVS_PIXEL_ORDER_RGBA 0
|
||||
#define HVS_PIXEL_ORDER_BGRA 1
|
||||
#define HVS_PIXEL_ORDER_ARGB 2
|
||||
#define HVS_PIXEL_ORDER_ABGR 3
|
||||
|
||||
+/* For modes 666 and 888 (4 & 5) */
|
||||
#define HVS_PIXEL_ORDER_XBRG 0
|
||||
#define HVS_PIXEL_ORDER_XRBG 1
|
||||
#define HVS_PIXEL_ORDER_XRGB 2
|
||||
#define HVS_PIXEL_ORDER_XBGR 3
|
||||
|
||||
+/* For YCbCr modes (8-12, and 17) */
|
||||
#define HVS_PIXEL_ORDER_XYCBCR 0
|
||||
#define HVS_PIXEL_ORDER_XYCRCB 1
|
||||
#define HVS_PIXEL_ORDER_YXCBCR 2
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
From a273c7c5fdfc56b72ed6cbc54d8e76cfb83e4b07 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <8911409+pelwell@users.noreply.github.com>
|
||||
Date: Wed, 24 Aug 2022 11:14:40 +0100
|
||||
Subject: [PATCH 053/726] drm/vc4: Add async update support for cursor planes
|
||||
|
||||
Now that cursors are implemented as regular planes, all cursor
|
||||
movements result in atomic updates. As the firmware-kms driver
|
||||
doesn't support asynchronous updates, these are synchronous, which
|
||||
limits the update rate to the screen refresh rate. Xorg seems unaware
|
||||
of this (or at least of the effect of this), because if the mouse is
|
||||
configured with a higher update rate than the screen then continuous
|
||||
mouse movement results in an increasing backlog of mouse events -
|
||||
cue extreme lag.
|
||||
|
||||
Add minimal support for asynchronous updates - limited to cursor
|
||||
planes - to eliminate the lag.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/pull/4971
|
||||
https://github.com/raspberrypi/linux/issues/4988
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_firmware_kms.c | 46 ++++++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
|
||||
index 6856de434928..e7f56b3eb213 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
|
||||
@@ -675,6 +675,50 @@ static int vc4_plane_atomic_check(struct drm_plane *plane,
|
||||
return vc4_plane_to_mb(plane, &vc4_plane->mb, new_plane_state);
|
||||
}
|
||||
|
||||
+static void vc4_plane_atomic_async_update(struct drm_plane *plane,
|
||||
+ struct drm_atomic_state *state)
|
||||
+{
|
||||
+ struct drm_plane_state *new_plane_state =
|
||||
+ drm_atomic_get_new_plane_state(state, plane);
|
||||
+
|
||||
+ swap(plane->state->fb, new_plane_state->fb);
|
||||
+ plane->state->crtc_x = new_plane_state->crtc_x;
|
||||
+ plane->state->crtc_y = new_plane_state->crtc_y;
|
||||
+ plane->state->crtc_w = new_plane_state->crtc_w;
|
||||
+ plane->state->crtc_h = new_plane_state->crtc_h;
|
||||
+ plane->state->src_x = new_plane_state->src_x;
|
||||
+ plane->state->src_y = new_plane_state->src_y;
|
||||
+ plane->state->src_w = new_plane_state->src_w;
|
||||
+ plane->state->src_h = new_plane_state->src_h;
|
||||
+ plane->state->alpha = new_plane_state->alpha;
|
||||
+ plane->state->pixel_blend_mode = new_plane_state->pixel_blend_mode;
|
||||
+ plane->state->rotation = new_plane_state->rotation;
|
||||
+ plane->state->zpos = new_plane_state->zpos;
|
||||
+ plane->state->normalized_zpos = new_plane_state->normalized_zpos;
|
||||
+ plane->state->color_encoding = new_plane_state->color_encoding;
|
||||
+ plane->state->color_range = new_plane_state->color_range;
|
||||
+ plane->state->src = new_plane_state->src;
|
||||
+ plane->state->dst = new_plane_state->dst;
|
||||
+ plane->state->visible = new_plane_state->visible;
|
||||
+
|
||||
+ vc4_plane_set_blank(plane, false);
|
||||
+}
|
||||
+
|
||||
+static int vc4_plane_atomic_async_check(struct drm_plane *plane,
|
||||
+ struct drm_atomic_state *state)
|
||||
+{
|
||||
+ struct drm_plane_state *new_plane_state =
|
||||
+ drm_atomic_get_new_plane_state(state, plane);
|
||||
+ int ret = -EINVAL;
|
||||
+
|
||||
+ if (plane->type == 2 &&
|
||||
+ plane->state->fb &&
|
||||
+ new_plane_state->crtc->state->active)
|
||||
+ ret = 0;
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/* Called during init to allocate the plane's atomic state. */
|
||||
static void vc4_plane_reset(struct drm_plane *plane)
|
||||
{
|
||||
@@ -769,6 +813,8 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
|
||||
.atomic_check = vc4_plane_atomic_check,
|
||||
.atomic_update = vc4_plane_atomic_update,
|
||||
.atomic_disable = vc4_plane_atomic_disable,
|
||||
+ .atomic_async_check = vc4_plane_atomic_async_check,
|
||||
+ .atomic_async_update = vc4_plane_atomic_async_update,
|
||||
};
|
||||
|
||||
static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev,
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
From 583c01b9c43f690293b6d7254634d4eef4406acd Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Aug 2022 13:49:16 +0100
|
||||
Subject: [PATCH 054/726] drm/vc4: Configure the HVS COB allocations
|
||||
|
||||
The HVS Composite Output Buffer (COB) is the memory used to
|
||||
generate the output pixel data.
|
||||
Until now the vc4 driver has been relying on the firmware to
|
||||
have set these to sensible values.
|
||||
|
||||
In testing triple screen support it has been noted that only
|
||||
1 line was being assigned to HVS channel 2. Whilst that is fine
|
||||
for the transposer (TXP), and indeed needed as only some pixels
|
||||
have an alpha channel, it is insufficient to run a live display.
|
||||
|
||||
Split the COB more evenly between the 3 HVS channels.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
|
||||
Revert vc4_regs change
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 56 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 55 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 67effc334715..23f8da10ea53 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -1013,7 +1013,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
|
||||
struct vc4_hvs *hvs = NULL;
|
||||
int ret;
|
||||
u32 dispctrl;
|
||||
- u32 reg;
|
||||
+ u32 reg, top;
|
||||
|
||||
hvs = drmm_kzalloc(drm, sizeof(*hvs), GFP_KERNEL);
|
||||
if (!hvs)
|
||||
@@ -1151,6 +1151,60 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
|
||||
|
||||
HVS_WRITE(SCALER_DISPCTRL, dispctrl);
|
||||
|
||||
+ /* Recompute Composite Output Buffer (COB) allocations for the displays
|
||||
+ */
|
||||
+ if (!vc4->is_vc5) {
|
||||
+ /* The COB is 20736 pixels, or just over 10 lines at 2048 wide.
|
||||
+ * The bottom 2048 pixels are full 32bpp RGBA (intended for the
|
||||
+ * TXP composing RGBA to memory), whilst the remainder are only
|
||||
+ * 24bpp RGB.
|
||||
+ *
|
||||
+ * Assign 3 lines to channels 1 & 2, and just over 4 lines to
|
||||
+ * channel 0.
|
||||
+ */
|
||||
+ #define VC4_COB_SIZE 20736
|
||||
+ #define VC4_COB_LINE_WIDTH 2048
|
||||
+ #define VC4_COB_NUM_LINES 3
|
||||
+ reg = 0;
|
||||
+ top = VC4_COB_LINE_WIDTH * VC4_COB_NUM_LINES;
|
||||
+ reg |= (top - 1) << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE2, reg);
|
||||
+ reg = top;
|
||||
+ top += VC4_COB_LINE_WIDTH * VC4_COB_NUM_LINES;
|
||||
+ reg |= (top - 1) << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE1, reg);
|
||||
+ reg = top;
|
||||
+ top = VC4_COB_SIZE;
|
||||
+ reg |= (top - 1) << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE0, reg);
|
||||
+ } else {
|
||||
+ /* The COB is 44416 pixels, or 10.8 lines at 4096 wide.
|
||||
+ * The bottom 4096 pixels are full RGBA (intended for the TXP
|
||||
+ * composing RGBA to memory), whilst the remainder are only
|
||||
+ * RGB. Addressing is always pixel wide.
|
||||
+ *
|
||||
+ * Assign 3 lines of 4096 to channels 1 & 2, and just over 4
|
||||
+ * lines. to channel 0.
|
||||
+ */
|
||||
+ #define VC5_COB_SIZE 44416
|
||||
+ #define VC5_COB_LINE_WIDTH 4096
|
||||
+ #define VC5_COB_NUM_LINES 3
|
||||
+ reg = 0;
|
||||
+ top = VC5_COB_LINE_WIDTH * VC5_COB_NUM_LINES;
|
||||
+ reg |= top << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE2, reg);
|
||||
+ top += 16;
|
||||
+ reg = top;
|
||||
+ top += VC5_COB_LINE_WIDTH * VC5_COB_NUM_LINES;
|
||||
+ reg |= top << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE1, reg);
|
||||
+ top += 16;
|
||||
+ reg = top;
|
||||
+ top = VC5_COB_SIZE;
|
||||
+ reg |= top << 16;
|
||||
+ HVS_WRITE(SCALER_DISPBASE0, reg);
|
||||
+ }
|
||||
+
|
||||
ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
|
||||
vc4_hvs_irq_handler, 0, "vc4 hvs", drm);
|
||||
if (ret)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
From 1d4f8c2573da23a2552342809135deb80b7af1d6 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 11 Aug 2022 13:59:34 +0100
|
||||
Subject: [PATCH 055/726] drm/vc4: Set AXI panic modes for the HVS
|
||||
|
||||
The HVS can change AXI request mode based on how full the COB
|
||||
FIFOs are.
|
||||
Until now the vc4 driver has been relying on the firmware to
|
||||
have set these to sensible values.
|
||||
|
||||
With HVS channel 2 now being used for live video, change the
|
||||
panic mode for all channels to be explicitly set by the driver,
|
||||
and the same for all channels.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 23f8da10ea53..97388f9a75bc 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -1138,6 +1138,17 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
|
||||
SCALER_DISPCTRL_SCLEIRQ);
|
||||
|
||||
|
||||
+ /* Set AXI panic mode.
|
||||
+ * VC4 panics when < 2 lines in FIFO.
|
||||
+ * VC5 panics when less than 1 line in the FIFO.
|
||||
+ */
|
||||
+ dispctrl &= ~(SCALER_DISPCTRL_PANIC0_MASK |
|
||||
+ SCALER_DISPCTRL_PANIC1_MASK |
|
||||
+ SCALER_DISPCTRL_PANIC2_MASK);
|
||||
+ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC0);
|
||||
+ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1);
|
||||
+ dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2);
|
||||
+
|
||||
/* Set AXI panic mode.
|
||||
* VC4 panics when < 2 lines in FIFO.
|
||||
* VC5 panics when less than 1 line in the FIFO.
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 0715fdccf7930f3b864aee3d2afaaa60afa6e5bc Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 11 Jul 2022 10:38:25 +0200
|
||||
Subject: [PATCH 056/726] drm/vc4: hvs: Skip DebugFS Registration for FKMS
|
||||
|
||||
FKMS doesn't have an HVS and it's expected. Return from the debugfs init
|
||||
function immediately if we're running with fkms.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/gpu/drm/vc4/vc4_hvs.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
index 97388f9a75bc..094887d4673e 100644
|
||||
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
||||
@@ -975,6 +975,9 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
|
||||
struct vc4_hvs *hvs = vc4->hvs;
|
||||
int ret;
|
||||
|
||||
+ if (vc4->firmware_kms)
|
||||
+ return 0;
|
||||
+
|
||||
if (!vc4->hvs)
|
||||
return -ENODEV;
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From 88356ff172b4662d9adeb56cffdd26be4ec7a34a Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 15 Aug 2022 13:34:02 +0200
|
||||
Subject: [PATCH 057/726] media: uapi: Add some RGB bus formats for VC4 DPI
|
||||
output
|
||||
|
||||
The VC4 DPI controller can output more RGB formats that aren't described
|
||||
through a media bus format yet, so let's add them.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
include/uapi/linux/media-bus-format.h | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
|
||||
index ec3323dbb927..d4228d038b54 100644
|
||||
--- a/include/uapi/linux/media-bus-format.h
|
||||
+++ b/include/uapi/linux/media-bus-format.h
|
||||
@@ -34,19 +34,22 @@
|
||||
|
||||
#define MEDIA_BUS_FMT_FIXED 0x0001
|
||||
|
||||
-/* RGB - next is 0x1022 */
|
||||
+/* RGB - next is 0x1025 */
|
||||
#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
|
||||
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
|
||||
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
|
||||
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003
|
||||
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004
|
||||
#define MEDIA_BUS_FMT_RGB565_1X16 0x1017
|
||||
+#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI 0x1022
|
||||
#define MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005
|
||||
#define MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006
|
||||
#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
|
||||
#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
|
||||
+#define MEDIA_BUS_FMT_BGR666_1X18 0x1023
|
||||
#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
|
||||
#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
|
||||
+#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI 0x1024
|
||||
#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
|
||||
#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
|
||||
#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
From c752cc00641ac8182127d13038dd348cf5e144ea Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Thu, 7 Apr 2022 18:23:07 +0100
|
||||
Subject: [PATCH 058/726] raspberrypi-firmware: Update mailbox commands
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
include/soc/bcm2835/raspberrypi-firmware.h | 28 +++++++++++++++++++++-
|
||||
1 file changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
|
||||
index 811ea668c4a1..dd3bbc75e531 100644
|
||||
--- a/include/soc/bcm2835/raspberrypi-firmware.h
|
||||
+++ b/include/soc/bcm2835/raspberrypi-firmware.h
|
||||
@@ -36,6 +36,8 @@ struct rpi_firmware_property_tag_header {
|
||||
enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_PROPERTY_END = 0,
|
||||
RPI_FIRMWARE_GET_FIRMWARE_REVISION = 0x00000001,
|
||||
+ RPI_FIRMWARE_GET_FIRMWARE_VARIANT = 0x00000002,
|
||||
+ RPI_FIRMWARE_GET_FIRMWARE_HASH = 0x00000003,
|
||||
|
||||
RPI_FIRMWARE_SET_CURSOR_INFO = 0x00008010,
|
||||
RPI_FIRMWARE_SET_CURSOR_STATE = 0x00008011,
|
||||
@@ -71,6 +73,7 @@ enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_GET_DISPMANX_RESOURCE_MEM_HANDLE = 0x00030014,
|
||||
RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020,
|
||||
RPI_FIRMWARE_GET_CUSTOMER_OTP = 0x00030021,
|
||||
+ RPI_FIRMWARE_GET_EDID_BLOCK_DISPLAY = 0x00030023,
|
||||
RPI_FIRMWARE_GET_DOMAIN_STATE = 0x00030030,
|
||||
RPI_FIRMWARE_GET_THROTTLED = 0x00030046,
|
||||
RPI_FIRMWARE_GET_CLOCK_MEASURED = 0x00030047,
|
||||
@@ -89,8 +92,11 @@ enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_GET_PERIPH_REG = 0x00030045,
|
||||
RPI_FIRMWARE_SET_PERIPH_REG = 0x00038045,
|
||||
RPI_FIRMWARE_GET_POE_HAT_VAL = 0x00030049,
|
||||
- RPI_FIRMWARE_SET_POE_HAT_VAL = 0x00030050,
|
||||
+ RPI_FIRMWARE_SET_POE_HAT_VAL = 0x00038049,
|
||||
+ RPI_FIRMWARE_SET_POE_HAT_VAL_OLD = 0x00030050,
|
||||
RPI_FIRMWARE_NOTIFY_XHCI_RESET = 0x00030058,
|
||||
+ RPI_FIRMWARE_GET_REBOOT_FLAGS = 0x00030064,
|
||||
+ RPI_FIRMWARE_SET_REBOOT_FLAGS = 0x00038064,
|
||||
RPI_FIRMWARE_NOTIFY_DISPLAY_DONE = 0x00030066,
|
||||
|
||||
/* Dispmanx TAGS */
|
||||
@@ -105,9 +111,16 @@ enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_OFFSET = 0x00040009,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_GET_OVERSCAN = 0x0004000a,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_GET_PALETTE = 0x0004000b,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_LAYER = 0x0004000c,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_TRANSFORM = 0x0004000d,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_VSYNC = 0x0004000e,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF = 0x0004000f,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_GET_GPIOVIRTBUF = 0x00040010,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_RELEASE = 0x00048001,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID = 0x00040016,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_SET_DISPLAY_NUM = 0x00048013,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS = 0x00040013,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_SETTINGS = 0x00040014,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT = 0x00044003,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT = 0x00044004,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_DEPTH = 0x00044005,
|
||||
@@ -116,26 +129,39 @@ enum rpi_firmware_property_tag {
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_OFFSET = 0x00044009,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_OVERSCAN = 0x0004400a,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_PALETTE = 0x0004400b,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_TEST_LAYER = 0x0004400c,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_TEST_TRANSFORM = 0x0004400d,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_TEST_VSYNC = 0x0004400e,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH = 0x00048005,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_PIXEL_ORDER = 0x00048006,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_ALPHA_MODE = 0x00048007,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_SET_PITCH = 0x00048008,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET = 0x00048009,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_OVERSCAN = 0x0004800a,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE = 0x0004800b,
|
||||
+
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_TOUCHBUF = 0x0004801f,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_GPIOVIRTBUF = 0x00048020,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_VSYNC = 0x0004800e,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_SET_LAYER = 0x0004800c,
|
||||
+ RPI_FIRMWARE_FRAMEBUFFER_SET_TRANSFORM = 0x0004800d,
|
||||
RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f,
|
||||
|
||||
RPI_FIRMWARE_VCHIQ_INIT = 0x00048010,
|
||||
|
||||
+ RPI_FIRMWARE_SET_PLANE = 0x00048015,
|
||||
+ RPI_FIRMWARE_GET_DISPLAY_TIMING = 0x00040017,
|
||||
+ RPI_FIRMWARE_SET_TIMING = 0x00048017,
|
||||
+ RPI_FIRMWARE_GET_DISPLAY_CFG = 0x00040018,
|
||||
+ RPI_FIRMWARE_SET_DISPLAY_POWER = 0x00048019,
|
||||
RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001,
|
||||
RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001,
|
||||
};
|
||||
|
||||
+#define GET_DISPLAY_SETTINGS_PAYLOAD_SIZE 64
|
||||
+
|
||||
#if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
|
||||
int rpi_firmware_property(struct rpi_firmware *fw,
|
||||
u32 tag, void *data, size_t len);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
From b3a6f64800dfc79f4dabe61a1e085cbade54e64e Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 11 Jul 2022 15:58:36 +0200
|
||||
Subject: [PATCH 059/726] clk: bcm: rpi: Create helper to retrieve private data
|
||||
|
||||
The RaspberryPi firmware clocks driver uses in several instances a
|
||||
container_of to retrieve the struct raspberrypi_clk_data from a pointer
|
||||
to struct clk_hw. Let's create a small function to avoid duplicating it
|
||||
all over the place.
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
drivers/clk/bcm/clk-raspberrypi.c | 18 ++++++++++--------
|
||||
1 file changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
|
||||
index 679f4649a7ef..b967c7b714db 100644
|
||||
--- a/drivers/clk/bcm/clk-raspberrypi.c
|
||||
+++ b/drivers/clk/bcm/clk-raspberrypi.c
|
||||
@@ -75,6 +75,12 @@ struct raspberrypi_clk_data {
|
||||
struct raspberrypi_clk *rpi;
|
||||
};
|
||||
|
||||
+static inline
|
||||
+const struct raspberrypi_clk_data *clk_hw_to_data(const struct clk_hw *hw)
|
||||
+{
|
||||
+ return container_of(hw, struct raspberrypi_clk_data, hw);
|
||||
+}
|
||||
+
|
||||
struct raspberrypi_clk_variant {
|
||||
bool export;
|
||||
char *clkdev;
|
||||
@@ -187,8 +193,7 @@ static int raspberrypi_clock_property(struct rpi_firmware *firmware,
|
||||
|
||||
static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
|
||||
{
|
||||
- struct raspberrypi_clk_data *data =
|
||||
- container_of(hw, struct raspberrypi_clk_data, hw);
|
||||
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
||||
struct raspberrypi_clk *rpi = data->rpi;
|
||||
u32 val = 0;
|
||||
int ret;
|
||||
@@ -205,8 +210,7 @@ static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
|
||||
static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
- struct raspberrypi_clk_data *data =
|
||||
- container_of(hw, struct raspberrypi_clk_data, hw);
|
||||
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
||||
struct raspberrypi_clk *rpi = data->rpi;
|
||||
u32 val = 0;
|
||||
int ret;
|
||||
@@ -222,8 +226,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
||||
static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
- struct raspberrypi_clk_data *data =
|
||||
- container_of(hw, struct raspberrypi_clk_data, hw);
|
||||
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
||||
struct raspberrypi_clk *rpi = data->rpi;
|
||||
u32 _rate = rate;
|
||||
int ret;
|
||||
@@ -240,8 +243,7 @@ static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
static int raspberrypi_fw_dumb_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
- struct raspberrypi_clk_data *data =
|
||||
- container_of(hw, struct raspberrypi_clk_data, hw);
|
||||
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
||||
struct raspberrypi_clk_variant *variant = data->variant;
|
||||
|
||||
/*
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From d4d2889809a5168034c10823aa0d08f90baf7059 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Ripard <maxime@cerno.tech>
|
||||
Date: Mon, 6 Jun 2022 11:02:16 +0200
|
||||
Subject: [PATCH 060/726] arm64: setup: Fix build warning
|
||||
|
||||
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||||
---
|
||||
arch/arm64/kernel/setup.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
|
||||
index fea3223704b6..a2dd48655bc4 100644
|
||||
--- a/arch/arm64/kernel/setup.c
|
||||
+++ b/arch/arm64/kernel/setup.c
|
||||
@@ -222,9 +222,9 @@ static void __init request_standard_resources(void)
|
||||
size_t res_size;
|
||||
|
||||
kernel_code.start = __pa_symbol(_stext);
|
||||
- kernel_code.end = __pa_symbol(__init_begin - 1);
|
||||
+ kernel_code.end = __pa_symbol(__init_begin) - 1;
|
||||
kernel_data.start = __pa_symbol(_sdata);
|
||||
- kernel_data.end = __pa_symbol(_end - 1);
|
||||
+ kernel_data.end = __pa_symbol(_end) - 1;
|
||||
insert_resource(&iomem_resource, &kernel_code);
|
||||
insert_resource(&iomem_resource, &kernel_data);
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,27 +0,0 @@
|
|||
From d0e03f43c04d6b9c19c017a9e5c8d89019b2e172 Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Tue, 12 Apr 2022 20:07:20 +0100
|
||||
Subject: [PATCH 063/726] clk-raspberrypi: Add ISP to exported clocks
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/clk/bcm/clk-raspberrypi.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
|
||||
index b967c7b714db..9c4af1e70cae 100644
|
||||
--- a/drivers/clk/bcm/clk-raspberrypi.c
|
||||
+++ b/drivers/clk/bcm/clk-raspberrypi.c
|
||||
@@ -143,6 +143,9 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
|
||||
[RPI_FIRMWARE_HEVC_CLK_ID] = {
|
||||
.export = true,
|
||||
},
|
||||
+ [RPI_FIRMWARE_ISP_CLK_ID] = {
|
||||
+ .export = true,
|
||||
+ },
|
||||
[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
|
||||
.export = true,
|
||||
},
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
From 01f566f77ad2b88ccf41c2a7e8a889bd9e1c84c5 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sperl <kernel@martin.sperl.org>
|
||||
Date: Fri, 2 Sep 2016 16:45:27 +0100
|
||||
Subject: [PATCH 064/726] Register the clocks early during the boot process, so
|
||||
that special/critical clocks can get enabled early on in the boot process
|
||||
avoiding the risk of disabling a clock, pll_divider or pll when a claiming
|
||||
driver fails to install propperly - maybe it needs to defer.
|
||||
|
||||
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 15 +++++++++++++--
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index e74fe6219d14..1e629fa834bd 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -2319,8 +2319,15 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
||||
+ ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
||||
&cprman->onecell);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* note that we have registered all the clocks */
|
||||
+ dev_dbg(dev, "registered %d clocks\n", asize);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static const struct cprman_plat_data cprman_bcm2835_plat_data = {
|
||||
@@ -2346,7 +2353,11 @@ static struct platform_driver bcm2835_clk_driver = {
|
||||
.probe = bcm2835_clk_probe,
|
||||
};
|
||||
|
||||
-builtin_platform_driver(bcm2835_clk_driver);
|
||||
+static int __init __bcm2835_clk_driver_init(void)
|
||||
+{
|
||||
+ return platform_driver_register(&bcm2835_clk_driver);
|
||||
+}
|
||||
+core_initcall(__bcm2835_clk_driver_init);
|
||||
|
||||
MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
|
||||
MODULE_DESCRIPTION("BCM2835 clock driver");
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From 2261d953c6095077a2980367842089d993df8ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Mon, 13 Feb 2017 17:20:08 +0000
|
||||
Subject: [PATCH 065/726] clk-bcm2835: Mark used PLLs and dividers CRITICAL
|
||||
|
||||
The VPU configures and relies on several PLLs and dividers. Mark all
|
||||
enabled dividers and their PLLs as CRITICAL to prevent the kernel from
|
||||
switching them off.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 1e629fa834bd..03e583d07702 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -1407,6 +1407,11 @@ bcm2835_register_pll_divider(struct bcm2835_cprman *cprman,
|
||||
divider->div.hw.init = &init;
|
||||
divider->div.table = NULL;
|
||||
|
||||
+ if (!(cprman_read(cprman, divider_data->cm_reg) & divider_data->hold_mask)) {
|
||||
+ init.flags |= CLK_IS_CRITICAL;
|
||||
+ divider->div.flags |= CLK_IS_CRITICAL;
|
||||
+ }
|
||||
+
|
||||
divider->cprman = cprman;
|
||||
divider->data = divider_data;
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
From ee3a45a20265f9fb791b9daaa6051831ef85fde8 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Mon, 13 Feb 2017 17:20:08 +0000
|
||||
Subject: [PATCH 066/726] clk-bcm2835: Add claim-clocks property
|
||||
|
||||
The claim-clocks property can be used to prevent PLLs and dividers
|
||||
from being marked as critical. It contains a vector of clock IDs,
|
||||
as defined by dt-bindings/clock/bcm2835.h.
|
||||
|
||||
Use this mechanism to claim PLLD_DSI0, PLLD_DSI1, PLLH_AUX and
|
||||
PLLH_PIX for the vc4_kms_v3d driver.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 43 +++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 03e583d07702..b6cdb19ef059 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -1335,6 +1335,8 @@ static const struct clk_ops bcm2835_vpu_clock_clk_ops = {
|
||||
.debug_init = bcm2835_clock_debug_init,
|
||||
};
|
||||
|
||||
+static bool bcm2835_clk_is_claimed(const char *name);
|
||||
+
|
||||
static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman,
|
||||
const void *data)
|
||||
{
|
||||
@@ -1352,6 +1354,9 @@ static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman,
|
||||
init.ops = &bcm2835_pll_clk_ops;
|
||||
init.flags = pll_data->flags | CLK_IGNORE_UNUSED;
|
||||
|
||||
+ if (!bcm2835_clk_is_claimed(pll_data->name))
|
||||
+ init.flags |= CLK_IS_CRITICAL;
|
||||
+
|
||||
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
|
||||
if (!pll)
|
||||
return NULL;
|
||||
@@ -1408,8 +1413,10 @@ bcm2835_register_pll_divider(struct bcm2835_cprman *cprman,
|
||||
divider->div.table = NULL;
|
||||
|
||||
if (!(cprman_read(cprman, divider_data->cm_reg) & divider_data->hold_mask)) {
|
||||
- init.flags |= CLK_IS_CRITICAL;
|
||||
- divider->div.flags |= CLK_IS_CRITICAL;
|
||||
+ if (!bcm2835_clk_is_claimed(divider_data->source_pll))
|
||||
+ init.flags |= CLK_IS_CRITICAL;
|
||||
+ if (!bcm2835_clk_is_claimed(divider_data->name))
|
||||
+ divider->div.flags |= CLK_IS_CRITICAL;
|
||||
}
|
||||
|
||||
divider->cprman = cprman;
|
||||
@@ -1465,6 +1472,15 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,
|
||||
init.name = clock_data->name;
|
||||
init.flags = clock_data->flags | CLK_IGNORE_UNUSED;
|
||||
|
||||
+ /*
|
||||
+ * Some GPIO clocks for ethernet/wifi PLLs are marked as
|
||||
+ * critical (since some platforms use them), but if the
|
||||
+ * firmware didn't have them turned on then they clearly
|
||||
+ * aren't actually critical.
|
||||
+ */
|
||||
+ if ((cprman_read(cprman, clock_data->ctl_reg) & CM_ENABLE) == 0)
|
||||
+ init.flags &= ~CLK_IS_CRITICAL;
|
||||
+
|
||||
/*
|
||||
* Pass the CLK_SET_RATE_PARENT flag if we are allowed to propagate
|
||||
* rate changes on at least of the parents.
|
||||
@@ -2245,6 +2261,8 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
|
||||
.ctl_reg = CM_PERIICTL),
|
||||
};
|
||||
|
||||
+static bool bcm2835_clk_claimed[ARRAY_SIZE(clk_desc_array)];
|
||||
+
|
||||
/*
|
||||
* Permanently take a reference on the parent of the SDRAM clock.
|
||||
*
|
||||
@@ -2264,6 +2282,19 @@ static int bcm2835_mark_sdc_parent_critical(struct clk *sdc)
|
||||
return clk_prepare_enable(parent);
|
||||
}
|
||||
|
||||
+static bool bcm2835_clk_is_claimed(const char *name)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(clk_desc_array); i++) {
|
||||
+ const char *clk_name = *(const char **)(clk_desc_array[i].data);
|
||||
+ if (!strcmp(name, clk_name))
|
||||
+ return bcm2835_clk_claimed[i];
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -2273,6 +2304,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
const size_t asize = ARRAY_SIZE(clk_desc_array);
|
||||
const struct cprman_plat_data *pdata;
|
||||
size_t i;
|
||||
+ u32 clk_id;
|
||||
int ret;
|
||||
|
||||
pdata = of_device_get_match_data(&pdev->dev);
|
||||
@@ -2291,6 +2323,13 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(cprman->regs))
|
||||
return PTR_ERR(cprman->regs);
|
||||
|
||||
+ memset(bcm2835_clk_claimed, 0, sizeof(bcm2835_clk_claimed));
|
||||
+ for (i = 0;
|
||||
+ !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks",
|
||||
+ i, &clk_id);
|
||||
+ i++)
|
||||
+ bcm2835_clk_claimed[clk_id]= true;
|
||||
+
|
||||
memcpy(cprman->real_parent_names, cprman_parent_names,
|
||||
sizeof(cprman_parent_names));
|
||||
of_clk_parent_fill(dev->of_node, cprman->real_parent_names,
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
From 5d54c8ce0268c5ae84a238b02fa39d1cf9bd25ef Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Mon, 6 Mar 2017 09:06:18 +0000
|
||||
Subject: [PATCH 067/726] clk-bcm2835: Read max core clock from firmware
|
||||
|
||||
The VPU is responsible for managing the core clock, usually under
|
||||
direction from the bcm2835-cpufreq driver but not via the clk-bcm2835
|
||||
driver. Since the core frequency can change without warning, it is
|
||||
safer to report the maximum clock rate to users of the core clock -
|
||||
I2C, SPI and the mini UART - to err on the safe side when calculating
|
||||
clock divisors.
|
||||
|
||||
If the DT node for the clock driver includes a reference to the
|
||||
firmware node, use the firmware API to query the maximum core clock
|
||||
instead of reading the divider registers.
|
||||
|
||||
Prior to this patch, a "100KHz" I2C bus was sometimes clocked at about
|
||||
160KHz. In particular, switching to the 4.9 kernel was likely to break
|
||||
SenseHAT usage on a Pi3.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 38 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index b6cdb19ef059..406ac78b08a6 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <dt-bindings/clock/bcm2835.h>
|
||||
+#include <soc/bcm2835/raspberrypi-firmware.h>
|
||||
|
||||
#define CM_PASSWORD 0x5a000000
|
||||
|
||||
@@ -296,6 +297,8 @@
|
||||
#define SOC_BCM2711 BIT(1)
|
||||
#define SOC_ALL (SOC_BCM2835 | SOC_BCM2711)
|
||||
|
||||
+#define VCMSG_ID_CORE_CLOCK 4
|
||||
+
|
||||
/*
|
||||
* Names of clocks used within the driver that need to be replaced
|
||||
* with an external parent's name. This array is in the order that
|
||||
@@ -314,6 +317,7 @@ static const char *const cprman_parent_names[] = {
|
||||
struct bcm2835_cprman {
|
||||
struct device *dev;
|
||||
void __iomem *regs;
|
||||
+ struct rpi_firmware *fw;
|
||||
spinlock_t regs_lock; /* spinlock for all clocks */
|
||||
unsigned int soc;
|
||||
|
||||
@@ -1039,6 +1043,30 @@ static unsigned long bcm2835_clock_get_rate(struct clk_hw *hw,
|
||||
return rate;
|
||||
}
|
||||
|
||||
+static unsigned long bcm2835_clock_get_rate_vpu(struct clk_hw *hw,
|
||||
+ unsigned long parent_rate)
|
||||
+{
|
||||
+ struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
|
||||
+ struct bcm2835_cprman *cprman = clock->cprman;
|
||||
+
|
||||
+ if (cprman->fw) {
|
||||
+ struct {
|
||||
+ u32 id;
|
||||
+ u32 val;
|
||||
+ } packet;
|
||||
+
|
||||
+ packet.id = VCMSG_ID_CORE_CLOCK;
|
||||
+ packet.val = 0;
|
||||
+
|
||||
+ if (!rpi_firmware_property(cprman->fw,
|
||||
+ RPI_FIRMWARE_GET_MAX_CLOCK_RATE,
|
||||
+ &packet, sizeof(packet)))
|
||||
+ return packet.val;
|
||||
+ }
|
||||
+
|
||||
+ return bcm2835_clock_get_rate(hw, parent_rate);
|
||||
+}
|
||||
+
|
||||
static void bcm2835_clock_wait_busy(struct bcm2835_clock *clock)
|
||||
{
|
||||
struct bcm2835_cprman *cprman = clock->cprman;
|
||||
@@ -1327,7 +1355,7 @@ static int bcm2835_vpu_clock_is_on(struct clk_hw *hw)
|
||||
*/
|
||||
static const struct clk_ops bcm2835_vpu_clock_clk_ops = {
|
||||
.is_prepared = bcm2835_vpu_clock_is_on,
|
||||
- .recalc_rate = bcm2835_clock_get_rate,
|
||||
+ .recalc_rate = bcm2835_clock_get_rate_vpu,
|
||||
.set_rate = bcm2835_clock_set_rate,
|
||||
.determine_rate = bcm2835_clock_determine_rate,
|
||||
.set_parent = bcm2835_clock_set_parent,
|
||||
@@ -2303,6 +2331,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
const struct bcm2835_clk_desc *desc;
|
||||
const size_t asize = ARRAY_SIZE(clk_desc_array);
|
||||
const struct cprman_plat_data *pdata;
|
||||
+ struct device_node *fw_node;
|
||||
size_t i;
|
||||
u32 clk_id;
|
||||
int ret;
|
||||
@@ -2323,6 +2352,14 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(cprman->regs))
|
||||
return PTR_ERR(cprman->regs);
|
||||
|
||||
+ fw_node = of_parse_phandle(dev->of_node, "firmware", 0);
|
||||
+ if (fw_node) {
|
||||
+ struct rpi_firmware *fw = rpi_firmware_get(NULL);
|
||||
+ if (!fw)
|
||||
+ return -EPROBE_DEFER;
|
||||
+ cprman->fw = fw;
|
||||
+ }
|
||||
+
|
||||
memset(bcm2835_clk_claimed, 0, sizeof(bcm2835_clk_claimed));
|
||||
for (i = 0;
|
||||
!of_property_read_u32_index(pdev->dev.of_node, "claim-clocks",
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From c07c369e59d863f5e89b548a60370c4b03811d95 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Thu, 24 Jan 2019 15:09:28 +0000
|
||||
Subject: [PATCH 068/726] clk: clk-bcm2835: Use %zd when printing size_t
|
||||
|
||||
The debug text for how many clocks have been registered
|
||||
uses "%d" with a size_t. Correct it to "%zd".
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 406ac78b08a6..060a45a59b70 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -2406,7 +2406,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
|
||||
/* note that we have registered all the clocks */
|
||||
- dev_dbg(dev, "registered %d clocks\n", asize);
|
||||
+ dev_dbg(dev, "registered %zd clocks\n", asize);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
From bc251ca0497a6e3e9595a73af52d2bc7905bd67d Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Wed, 23 Jan 2019 16:11:50 +0000
|
||||
Subject: [PATCH 069/726] clk-bcm2835: Don't wait for pllh lock
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 18 ++++++++++--------
|
||||
1 file changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 060a45a59b70..a808f35b75b9 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -647,15 +647,17 @@ static int bcm2835_pll_on(struct clk_hw *hw)
|
||||
spin_unlock(&cprman->regs_lock);
|
||||
|
||||
/* Wait for the PLL to lock. */
|
||||
- timeout = ktime_add_ns(ktime_get(), LOCK_TIMEOUT_NS);
|
||||
- while (!(cprman_read(cprman, CM_LOCK) & data->lock_mask)) {
|
||||
- if (ktime_after(ktime_get(), timeout)) {
|
||||
- dev_err(cprman->dev, "%s: couldn't lock PLL\n",
|
||||
- clk_hw_get_name(hw));
|
||||
- return -ETIMEDOUT;
|
||||
+ if (strcmp(data->name, "pllh")) {
|
||||
+ timeout = ktime_add_ns(ktime_get(), LOCK_TIMEOUT_NS);
|
||||
+ while (!(cprman_read(cprman, CM_LOCK) & data->lock_mask)) {
|
||||
+ if (ktime_after(ktime_get(), timeout)) {
|
||||
+ dev_err(cprman->dev, "%s: couldn't lock PLL\n",
|
||||
+ clk_hw_get_name(hw));
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+
|
||||
+ cpu_relax();
|
||||
}
|
||||
-
|
||||
- cpu_relax();
|
||||
}
|
||||
|
||||
cprman_write(cprman, data->a2w_ctrl_reg,
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
From 7cb62bfa20fd4674be2369c678af228c6cb99011 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Thu, 2 May 2019 15:11:05 -0700
|
||||
Subject: [PATCH 070/726] clk: bcm2835: Add support for setting leaf clock
|
||||
rates while running.
|
||||
|
||||
As long as you wait for !BUSY, you can do glitch-free updates of clock
|
||||
rate while the clock is running.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 22 +++++++++++++---------
|
||||
1 file changed, 13 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index a808f35b75b9..bc029be289dc 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -1138,15 +1138,19 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
|
||||
spin_lock(&cprman->regs_lock);
|
||||
|
||||
- /*
|
||||
- * Setting up frac support
|
||||
- *
|
||||
- * In principle it is recommended to stop/start the clock first,
|
||||
- * but as we set CLK_SET_RATE_GATE during registration of the
|
||||
- * clock this requirement should be take care of by the
|
||||
- * clk-framework.
|
||||
+ ctl = cprman_read(cprman, data->ctl_reg);
|
||||
+
|
||||
+ /* If the clock is running, we have to pause clock generation while
|
||||
+ * updating the control and div regs. This is glitchless (no clock
|
||||
+ * signals generated faster than the rate) but each reg access is two
|
||||
+ * OSC cycles so the clock will slow down for a moment.
|
||||
*/
|
||||
- ctl = cprman_read(cprman, data->ctl_reg) & ~CM_FRAC;
|
||||
+ if (ctl & CM_ENABLE) {
|
||||
+ cprman_write(cprman, data->ctl_reg, ctl & ~CM_ENABLE);
|
||||
+ bcm2835_clock_wait_busy(clock);
|
||||
+ }
|
||||
+
|
||||
+ ctl &= ~CM_FRAC;
|
||||
ctl |= (div & CM_DIV_FRAC_MASK) ? CM_FRAC : 0;
|
||||
cprman_write(cprman, data->ctl_reg, ctl);
|
||||
|
||||
@@ -1522,7 +1526,7 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,
|
||||
init.ops = &bcm2835_vpu_clock_clk_ops;
|
||||
} else {
|
||||
init.ops = &bcm2835_clock_clk_ops;
|
||||
- init.flags |= CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
|
||||
+ init.flags |= CLK_SET_PARENT_GATE;
|
||||
|
||||
/* If the clock wasn't actually enabled at boot, it's not
|
||||
* critical.
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
From d871116881c09d65d6482db2a6138d5ad81685d7 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Anholt <eric@anholt.net>
|
||||
Date: Thu, 2 May 2019 15:24:04 -0700
|
||||
Subject: [PATCH 071/726] clk: bcm2835: Allow reparenting leaf clocks while
|
||||
they're running.
|
||||
|
||||
This falls under the same "we can reprogram glitch-free as long as we
|
||||
pause generation" rule as updating the div/frac fields. This can be
|
||||
used for runtime reclocking of V3D to manage power leakage.
|
||||
|
||||
Signed-off-by: Eric Anholt <eric@anholt.net>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 19 ++++++++++++++++---
|
||||
1 file changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index bc029be289dc..971f0ad84b6b 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -1127,8 +1127,10 @@ static int bcm2835_clock_on(struct clk_hw *hw)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
- unsigned long rate, unsigned long parent_rate)
|
||||
+static int bcm2835_clock_set_rate_and_parent(struct clk_hw *hw,
|
||||
+ unsigned long rate,
|
||||
+ unsigned long parent_rate,
|
||||
+ u8 parent)
|
||||
{
|
||||
struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
|
||||
struct bcm2835_cprman *cprman = clock->cprman;
|
||||
@@ -1150,6 +1152,11 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
bcm2835_clock_wait_busy(clock);
|
||||
}
|
||||
|
||||
+ if (parent != 0xff) {
|
||||
+ ctl &= ~(CM_SRC_MASK << CM_SRC_SHIFT);
|
||||
+ ctl |= parent << CM_SRC_SHIFT;
|
||||
+ }
|
||||
+
|
||||
ctl &= ~CM_FRAC;
|
||||
ctl |= (div & CM_DIV_FRAC_MASK) ? CM_FRAC : 0;
|
||||
cprman_write(cprman, data->ctl_reg, ctl);
|
||||
@@ -1161,6 +1168,12 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
+ unsigned long rate, unsigned long parent_rate)
|
||||
+{
|
||||
+ return bcm2835_clock_set_rate_and_parent(hw, rate, parent_rate, 0xff);
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
bcm2835_clk_is_pllc(struct clk_hw *hw)
|
||||
{
|
||||
@@ -1344,6 +1357,7 @@ static const struct clk_ops bcm2835_clock_clk_ops = {
|
||||
.unprepare = bcm2835_clock_off,
|
||||
.recalc_rate = bcm2835_clock_get_rate,
|
||||
.set_rate = bcm2835_clock_set_rate,
|
||||
+ .set_rate_and_parent = bcm2835_clock_set_rate_and_parent,
|
||||
.determine_rate = bcm2835_clock_determine_rate,
|
||||
.set_parent = bcm2835_clock_set_parent,
|
||||
.get_parent = bcm2835_clock_get_parent,
|
||||
@@ -1526,7 +1540,6 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,
|
||||
init.ops = &bcm2835_vpu_clock_clk_ops;
|
||||
} else {
|
||||
init.ops = &bcm2835_clock_clk_ops;
|
||||
- init.flags |= CLK_SET_PARENT_GATE;
|
||||
|
||||
/* If the clock wasn't actually enabled at boot, it's not
|
||||
* critical.
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From 8504c4acefa2a4668405a42ccfd1d22a50357786 Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 6 Aug 2019 15:23:14 +0100
|
||||
Subject: [PATCH 072/726] clk-bcm2835: Avoid null pointer exception
|
||||
|
||||
clk_desc_array[BCM2835_PLLB] doesn't exist so we dereference null when iterating
|
||||
|
||||
Signed-off-by: popcornmix <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 971f0ad84b6b..3c59e5c29ec4 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -2334,9 +2334,11 @@ static bool bcm2835_clk_is_claimed(const char *name)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(clk_desc_array); i++) {
|
||||
- const char *clk_name = *(const char **)(clk_desc_array[i].data);
|
||||
- if (!strcmp(name, clk_name))
|
||||
- return bcm2835_clk_claimed[i];
|
||||
+ if (clk_desc_array[i].data) {
|
||||
+ const char *clk_name = *(const char **)(clk_desc_array[i].data);
|
||||
+ if (!strcmp(name, clk_name))
|
||||
+ return bcm2835_clk_claimed[i];
|
||||
+ }
|
||||
}
|
||||
|
||||
return false;
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
From 3d1f970a1ef328fa6e7033e6e3ef1d2f24b82951 Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 3 Sep 2019 20:28:00 +0100
|
||||
Subject: [PATCH 073/726] clk-bcm2835: Disable v3d clock
|
||||
|
||||
This is controlled by firmware, see clk-raspberrypi.c
|
||||
|
||||
Signed-off-by: popcornmix <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 30 ++++++++++++------------------
|
||||
1 file changed, 12 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 3c59e5c29ec4..90e16822f1d5 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -1764,16 +1764,12 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
|
||||
.hold_mask = CM_PLLA_HOLDCORE,
|
||||
.fixed_divider = 1,
|
||||
.flags = CLK_SET_RATE_PARENT),
|
||||
- [BCM2835_PLLA_PER] = REGISTER_PLL_DIV(
|
||||
- SOC_ALL,
|
||||
- .name = "plla_per",
|
||||
- .source_pll = "plla",
|
||||
- .cm_reg = CM_PLLA,
|
||||
- .a2w_reg = A2W_PLLA_PER,
|
||||
- .load_mask = CM_PLLA_LOADPER,
|
||||
- .hold_mask = CM_PLLA_HOLDPER,
|
||||
- .fixed_divider = 1,
|
||||
- .flags = CLK_SET_RATE_PARENT),
|
||||
+
|
||||
+ /*
|
||||
+ * PLLA_PER is used for gpu clocks. Controlled by firmware, see
|
||||
+ * clk-raspberrypi.c.
|
||||
+ */
|
||||
+
|
||||
[BCM2835_PLLA_DSI0] = REGISTER_PLL_DIV(
|
||||
SOC_ALL,
|
||||
.name = "plla_dsi0",
|
||||
@@ -2074,14 +2070,12 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
|
||||
.int_bits = 6,
|
||||
.frac_bits = 0,
|
||||
.tcnt_mux = 3),
|
||||
- [BCM2835_CLOCK_V3D] = REGISTER_VPU_CLK(
|
||||
- SOC_ALL,
|
||||
- .name = "v3d",
|
||||
- .ctl_reg = CM_V3DCTL,
|
||||
- .div_reg = CM_V3DDIV,
|
||||
- .int_bits = 4,
|
||||
- .frac_bits = 8,
|
||||
- .tcnt_mux = 4),
|
||||
+
|
||||
+ /*
|
||||
+ * CLOCK_V3D is used for v3d clock. Controlled by firmware, see
|
||||
+ * clk-raspberrypi.c.
|
||||
+ */
|
||||
+
|
||||
/*
|
||||
* VPU clock. This doesn't have an enable bit, since it drives
|
||||
* the bus for everything else, and is special so it doesn't need
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 23f9445f3453c9bd17aca63de45a8967e6af734a Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Thu, 8 Jul 2021 09:37:10 +0100
|
||||
Subject: [PATCH 074/726] clk: bcm2835: Pass DT node to rpi_firmware_get
|
||||
|
||||
The fw_node pointer has already been retrieved, and using it allows
|
||||
us to remove a downstream patch to the firmware driver.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 90e16822f1d5..448c5fcedbdf 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -2369,7 +2369,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
|
||||
|
||||
fw_node = of_parse_phandle(dev->of_node, "firmware", 0);
|
||||
if (fw_node) {
|
||||
- struct rpi_firmware *fw = rpi_firmware_get(NULL);
|
||||
+ struct rpi_firmware *fw = rpi_firmware_get(fw_node);
|
||||
if (!fw)
|
||||
return -EPROBE_DEFER;
|
||||
cprman->fw = fw;
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From 53cbeb3fe588cf2b50a029d25a530992c795ad0a Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Tue, 19 Oct 2021 14:14:55 +0100
|
||||
Subject: [PATCH 075/726] clk-bcm2835: Remove VEC clock support
|
||||
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
drivers/clk/bcm/clk-bcm2835.c | 15 ---------------
|
||||
1 file changed, 15 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
|
||||
index 448c5fcedbdf..fdef9aa7401e 100644
|
||||
--- a/drivers/clk/bcm/clk-bcm2835.c
|
||||
+++ b/drivers/clk/bcm/clk-bcm2835.c
|
||||
@@ -2238,21 +2238,6 @@ static const struct bcm2835_clk_desc clk_desc_array[] = {
|
||||
.tcnt_mux = 28,
|
||||
.round_up = true),
|
||||
|
||||
- /* TV encoder clock. Only operating frequency is 108Mhz. */
|
||||
- [BCM2835_CLOCK_VEC] = REGISTER_PER_CLK(
|
||||
- SOC_ALL,
|
||||
- .name = "vec",
|
||||
- .ctl_reg = CM_VECCTL,
|
||||
- .div_reg = CM_VECDIV,
|
||||
- .int_bits = 4,
|
||||
- .frac_bits = 0,
|
||||
- /*
|
||||
- * Allow rate change propagation only on PLLH_AUX which is
|
||||
- * assigned index 7 in the parent array.
|
||||
- */
|
||||
- .set_rate_parent = BIT(7),
|
||||
- .tcnt_mux = 29),
|
||||
-
|
||||
/* dsi clocks */
|
||||
[BCM2835_CLOCK_DSI0E] = REGISTER_PER_CLK(
|
||||
SOC_ALL,
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
From 19c45eaf4c79d255826fcae98bd9cf2ac493e5b3 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Pasanen <dan.pasanen@gmail.com>
|
||||
Date: Thu, 21 Sep 2017 09:55:42 -0500
|
||||
Subject: [PATCH 076/726] arm: partially revert
|
||||
702b94bff3c50542a6e4ab9a4f4cef093262fe65
|
||||
|
||||
* Re-expose some dmi APIs for use in VCSM
|
||||
---
|
||||
arch/arm/include/asm/cacheflush.h | 21 +++++++++++++++++++++
|
||||
arch/arm/include/asm/glue-cache.h | 2 ++
|
||||
arch/arm/mm/proc-macros.S | 2 ++
|
||||
arch/arm/mm/proc-syms.c | 3 +++
|
||||
4 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
|
||||
index a094f964c869..49c4145463e2 100644
|
||||
--- a/arch/arm/include/asm/cacheflush.h
|
||||
+++ b/arch/arm/include/asm/cacheflush.h
|
||||
@@ -91,6 +91,21 @@
|
||||
* DMA Cache Coherency
|
||||
* ===================
|
||||
*
|
||||
+ * dma_inv_range(start, end)
|
||||
+ *
|
||||
+ * Invalidate (discard) the specified virtual address range.
|
||||
+ * May not write back any entries. If 'start' or 'end'
|
||||
+ * are not cache line aligned, those lines must be written
|
||||
+ * back.
|
||||
+ * - start - virtual start address
|
||||
+ * - end - virtual end address
|
||||
+ *
|
||||
+ * dma_clean_range(start, end)
|
||||
+ *
|
||||
+ * Clean (write back) the specified virtual address range.
|
||||
+ * - start - virtual start address
|
||||
+ * - end - virtual end address
|
||||
+ *
|
||||
* dma_flush_range(start, end)
|
||||
*
|
||||
* Clean and invalidate the specified virtual address range.
|
||||
@@ -112,6 +127,8 @@ struct cpu_cache_fns {
|
||||
void (*dma_map_area)(const void *, size_t, int);
|
||||
void (*dma_unmap_area)(const void *, size_t, int);
|
||||
|
||||
+ void (*dma_inv_range)(const void *, const void *);
|
||||
+ void (*dma_clean_range)(const void *, const void *);
|
||||
void (*dma_flush_range)(const void *, const void *);
|
||||
} __no_randomize_layout;
|
||||
|
||||
@@ -137,6 +154,8 @@ extern struct cpu_cache_fns cpu_cache;
|
||||
* is visible to DMA, or data written by DMA to system memory is
|
||||
* visible to the CPU.
|
||||
*/
|
||||
+#define dmac_inv_range cpu_cache.dma_inv_range
|
||||
+#define dmac_clean_range cpu_cache.dma_clean_range
|
||||
#define dmac_flush_range cpu_cache.dma_flush_range
|
||||
|
||||
#else
|
||||
@@ -156,6 +175,8 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
|
||||
* is visible to DMA, or data written by DMA to system memory is
|
||||
* visible to the CPU.
|
||||
*/
|
||||
+extern void dmac_inv_range(const void *, const void *);
|
||||
+extern void dmac_clean_range(const void *, const void *);
|
||||
extern void dmac_flush_range(const void *, const void *);
|
||||
|
||||
#endif
|
||||
diff --git a/arch/arm/include/asm/glue-cache.h b/arch/arm/include/asm/glue-cache.h
|
||||
index 724f8dac1e5b..aa74173092dd 100644
|
||||
--- a/arch/arm/include/asm/glue-cache.h
|
||||
+++ b/arch/arm/include/asm/glue-cache.h
|
||||
@@ -155,6 +155,8 @@ static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
|
||||
#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
|
||||
#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
|
||||
|
||||
+#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
|
||||
+#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
|
||||
#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
|
||||
#endif
|
||||
|
||||
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
|
||||
index fa6999e24b07..68887357ac57 100644
|
||||
--- a/arch/arm/mm/proc-macros.S
|
||||
+++ b/arch/arm/mm/proc-macros.S
|
||||
@@ -333,6 +333,8 @@ ENTRY(\name\()_cache_fns)
|
||||
.long \name\()_flush_kern_dcache_area
|
||||
.long \name\()_dma_map_area
|
||||
.long \name\()_dma_unmap_area
|
||||
+ .long \name\()_dma_inv_range
|
||||
+ .long \name\()_dma_clean_range
|
||||
.long \name\()_dma_flush_range
|
||||
.size \name\()_cache_fns, . - \name\()_cache_fns
|
||||
.endm
|
||||
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
|
||||
index e21249548e9f..33e4a9b8f1ba 100644
|
||||
--- a/arch/arm/mm/proc-syms.c
|
||||
+++ b/arch/arm/mm/proc-syms.c
|
||||
@@ -27,6 +27,9 @@ EXPORT_SYMBOL(__cpuc_flush_user_all);
|
||||
EXPORT_SYMBOL(__cpuc_flush_user_range);
|
||||
EXPORT_SYMBOL(__cpuc_coherent_kern_range);
|
||||
EXPORT_SYMBOL(__cpuc_flush_dcache_area);
|
||||
+EXPORT_SYMBOL(dmac_inv_range);
|
||||
+EXPORT_SYMBOL(dmac_clean_range);
|
||||
+EXPORT_SYMBOL(dmac_flush_range);
|
||||
#else
|
||||
EXPORT_SYMBOL(cpu_cache);
|
||||
#endif
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
From 0542fa2dc55c86ac015b6f5864d331a869c2a42c Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Fri, 25 Aug 2017 19:18:13 +0100
|
||||
Subject: [PATCH 077/726] cache: export clean and invalidate
|
||||
|
||||
hack: cache: Fix linker error
|
||||
---
|
||||
arch/arm/mm/cache-v6.S | 4 ++--
|
||||
arch/arm/mm/cache-v7.S | 6 ++++--
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
|
||||
index f0f65eb073e4..868011801521 100644
|
||||
--- a/arch/arm/mm/cache-v6.S
|
||||
+++ b/arch/arm/mm/cache-v6.S
|
||||
@@ -198,7 +198,7 @@ ENTRY(v6_flush_kern_dcache_area)
|
||||
* - start - virtual start address of region
|
||||
* - end - virtual end address of region
|
||||
*/
|
||||
-v6_dma_inv_range:
|
||||
+ENTRY(v6_dma_inv_range)
|
||||
#ifdef CONFIG_DMA_CACHE_RWFO
|
||||
ldrb r2, [r0] @ read for ownership
|
||||
strb r2, [r0] @ write for ownership
|
||||
@@ -243,7 +243,7 @@ v6_dma_inv_range:
|
||||
* - start - virtual start address of region
|
||||
* - end - virtual end address of region
|
||||
*/
|
||||
-v6_dma_clean_range:
|
||||
+ENTRY(v6_dma_clean_range)
|
||||
bic r0, r0, #D_CACHE_LINE_SIZE - 1
|
||||
1:
|
||||
#ifdef CONFIG_DMA_CACHE_RWFO
|
||||
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
|
||||
index 7c9499b728c4..499e55bda16f 100644
|
||||
--- a/arch/arm/mm/cache-v7.S
|
||||
+++ b/arch/arm/mm/cache-v7.S
|
||||
@@ -359,7 +359,8 @@ ENDPROC(v7_flush_kern_dcache_area)
|
||||
* - start - virtual start address of region
|
||||
* - end - virtual end address of region
|
||||
*/
|
||||
-v7_dma_inv_range:
|
||||
+ENTRY(b15_dma_inv_range)
|
||||
+ENTRY(v7_dma_inv_range)
|
||||
dcache_line_size r2, r3
|
||||
sub r3, r2, #1
|
||||
tst r0, r3
|
||||
@@ -389,7 +390,8 @@ ENDPROC(v7_dma_inv_range)
|
||||
* - start - virtual start address of region
|
||||
* - end - virtual end address of region
|
||||
*/
|
||||
-v7_dma_clean_range:
|
||||
+ENTRY(b15_dma_clean_range)
|
||||
+ENTRY(v7_dma_clean_range)
|
||||
dcache_line_size r2, r3
|
||||
sub r3, r2, #1
|
||||
bic r0, r0, r3
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From da4c39c84fbee2224a586249d3d5a337dede635f Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 20 Apr 2020 13:41:10 +0100
|
||||
Subject: [PATCH 078/726] Revert "spi: spidev: Fix CS polarity if GPIO
|
||||
descriptors are used"
|
||||
|
||||
This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28.
|
||||
---
|
||||
drivers/spi/spidev.c | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
|
||||
index 71c3db60e968..1dcf8886efb9 100644
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -414,7 +414,6 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
else
|
||||
retval = get_user(tmp, (u32 __user *)arg);
|
||||
if (retval == 0) {
|
||||
- struct spi_controller *ctlr = spi->controller;
|
||||
u32 save = spi->mode;
|
||||
|
||||
if (tmp & ~SPI_MODE_MASK) {
|
||||
@@ -422,10 +421,6 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
- if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods &&
|
||||
- ctlr->cs_gpiods[spi->chip_select])
|
||||
- tmp |= SPI_CS_HIGH;
|
||||
-
|
||||
tmp |= spi->mode & ~SPI_MODE_MASK;
|
||||
spi->mode = tmp & SPI_MODE_USER_MASK;
|
||||
retval = spi_setup(spi);
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
From b0bb01820a0ef2ddd1aeb264f0e2d2e7f7647f89 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 1 Mar 2021 09:12:44 +0000
|
||||
Subject: [PATCH 079/726] Revert "Bluetooth: Always request for user
|
||||
confirmation for Just Works (LE SC)"
|
||||
|
||||
This reverts commit ffee202a78c2980688bc5d2f7d56480e69a5e0c9.
|
||||
|
||||
The commit "Bluetooth: Always request for user confirmation for Just
|
||||
Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS
|
||||
GUI. After reverting it, pairing works again. Although this companion
|
||||
commit ("... (LE SC)") has not been demonstrated to be problematic,
|
||||
it follows the same logic and therefore could affect some use cases.
|
||||
|
||||
If another solution to the problem is found then this reversion will
|
||||
be removed.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/4139
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
net/bluetooth/smp.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
|
||||
index 70663229b3cc..903221ad7611 100644
|
||||
--- a/net/bluetooth/smp.c
|
||||
+++ b/net/bluetooth/smp.c
|
||||
@@ -2207,7 +2207,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
if (err)
|
||||
return SMP_UNSPECIFIED;
|
||||
|
||||
- if (smp->method == REQ_OOB) {
|
||||
+ if (smp->method == JUST_WORKS || smp->method == REQ_OOB) {
|
||||
if (hcon->out) {
|
||||
sc_dhkey_check(smp);
|
||||
SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
|
||||
@@ -2222,9 +2222,6 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
|
||||
confirm_hint = 0;
|
||||
|
||||
confirm:
|
||||
- if (smp->method == JUST_WORKS)
|
||||
- confirm_hint = 1;
|
||||
-
|
||||
err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type,
|
||||
hcon->dst_type, passkey, confirm_hint);
|
||||
if (err)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
From 0839fcb80fede4d48b85ac237c670d32fb5d1900 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 1 Mar 2021 09:14:35 +0000
|
||||
Subject: [PATCH 080/726] Revert "Bluetooth: Always request for user
|
||||
confirmation for Just Works"
|
||||
|
||||
This reverts commit 92516cd97fd4d8ad5b1421a0d51771044f453a5f.
|
||||
|
||||
Thi commit "Bluetooth: Always request for user confirmation for Just
|
||||
Works" prevents BLE devices pairing in (at least) the Raspberry Pi OS
|
||||
GUI. After reverting it, pairing works again.
|
||||
|
||||
If another solution to the problem is found then this reversion will
|
||||
be removed.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/4139
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
net/bluetooth/smp.c | 11 ++---------
|
||||
1 file changed, 2 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
|
||||
index 903221ad7611..0f7dafc9bf99 100644
|
||||
--- a/net/bluetooth/smp.c
|
||||
+++ b/net/bluetooth/smp.c
|
||||
@@ -883,16 +883,9 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
|
||||
hcon->io_capability == HCI_IO_NO_INPUT_OUTPUT)
|
||||
smp->method = JUST_WORKS;
|
||||
|
||||
- /* If Just Works, Continue with Zero TK and ask user-space for
|
||||
- * confirmation */
|
||||
+ /* If Just Works, Continue with Zero TK */
|
||||
if (smp->method == JUST_WORKS) {
|
||||
- ret = mgmt_user_confirm_request(hcon->hdev, &hcon->dst,
|
||||
- hcon->type,
|
||||
- hcon->dst_type,
|
||||
- passkey, 1);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
- set_bit(SMP_FLAG_WAIT_USER, &smp->flags);
|
||||
+ set_bit(SMP_FLAG_TK_VALID, &smp->flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From c0438d07753dd711a6182f62a1c73e456d50c33e Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 7 Mar 2022 16:18:55 +0000
|
||||
Subject: [PATCH 081/726] Revert "net: bcmgenet: Request APD, DLL disable and
|
||||
IDDQ-SR"
|
||||
|
||||
This reverts commit c3a4c69360ab43560f212eed326c9d8bde35b14c, which
|
||||
broke rebooting when network booting.
|
||||
|
||||
See: https://github.com/raspberrypi/rpi-eeprom/issues/417
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/genet/bcmmii.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
|
||||
index ded0e64a9f6a..7ec07f071fc9 100644
|
||||
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
|
||||
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
|
||||
@@ -285,9 +285,7 @@ int bcmgenet_mii_probe(struct net_device *dev)
|
||||
struct device_node *dn = kdev->of_node;
|
||||
phy_interface_t phy_iface = priv->phy_interface;
|
||||
struct phy_device *phydev;
|
||||
- u32 phy_flags = PHY_BRCM_AUTO_PWRDWN_ENABLE |
|
||||
- PHY_BRCM_DIS_TXCRXC_NOENRGY |
|
||||
- PHY_BRCM_IDDQ_SUSPEND;
|
||||
+ u32 phy_flags = 0;
|
||||
int ret;
|
||||
|
||||
/* Communicate the integrated PHY revision */
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
From 8b4f0997052306b5d530170041978e76701138be Mon Sep 17 00:00:00 2001
|
||||
From: Steve Glendinning <steve.glendinning@smsc.com>
|
||||
Date: Thu, 19 Feb 2015 18:47:12 +0000
|
||||
Subject: [PATCH 082/726] smsx95xx: fix crimes against truesize
|
||||
|
||||
smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.
|
||||
|
||||
This patch stops smsc95xx from changing truesize.
|
||||
|
||||
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
|
||||
---
|
||||
drivers/net/usb/smsc95xx.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
|
||||
index 32d2c60d334d..7c817d9007c8 100644
|
||||
--- a/drivers/net/usb/smsc95xx.c
|
||||
+++ b/drivers/net/usb/smsc95xx.c
|
||||
@@ -79,6 +79,10 @@ static bool turbo_mode = true;
|
||||
module_param(turbo_mode, bool, 0644);
|
||||
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
|
||||
|
||||
+static bool truesize_mode = false;
|
||||
+module_param(truesize_mode, bool, 0644);
|
||||
+MODULE_PARM_DESC(truesize_mode, "Report larger truesize value");
|
||||
+
|
||||
static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
u32 *data)
|
||||
{
|
||||
@@ -1862,7 +1866,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
||||
if (dev->net->features & NETIF_F_RXCSUM)
|
||||
smsc95xx_rx_csum_offload(skb);
|
||||
skb_trim(skb, skb->len - 4); /* remove fcs */
|
||||
- skb->truesize = size + sizeof(struct sk_buff);
|
||||
+ if (truesize_mode)
|
||||
+ skb->truesize = size + sizeof(struct sk_buff);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1880,7 +1885,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
||||
if (dev->net->features & NETIF_F_RXCSUM)
|
||||
smsc95xx_rx_csum_offload(ax_skb);
|
||||
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
|
||||
- ax_skb->truesize = size + sizeof(struct sk_buff);
|
||||
+ if (truesize_mode)
|
||||
+ ax_skb->truesize = size + sizeof(struct sk_buff);
|
||||
|
||||
usbnet_skb_return(dev, ax_skb);
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
From 60a438fc98237d87979737ced3ef95f9c0df0e88 Mon Sep 17 00:00:00 2001
|
||||
From: Sam Nazarko <email@samnazarko.co.uk>
|
||||
Date: Fri, 1 Apr 2016 17:27:21 +0100
|
||||
Subject: [PATCH 083/726] smsc95xx: Experimental: Enable turbo_mode and
|
||||
packetsize=2560 by default
|
||||
|
||||
See: http://forum.kodi.tv/showthread.php?tid=285288
|
||||
---
|
||||
drivers/net/usb/smsc95xx.c | 14 +++++++++-----
|
||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
|
||||
index 7c817d9007c8..89490cc451ac 100644
|
||||
--- a/drivers/net/usb/smsc95xx.c
|
||||
+++ b/drivers/net/usb/smsc95xx.c
|
||||
@@ -83,6 +83,10 @@ static bool truesize_mode = false;
|
||||
module_param(truesize_mode, bool, 0644);
|
||||
MODULE_PARM_DESC(truesize_mode, "Report larger truesize value");
|
||||
|
||||
+static int packetsize = 2560;
|
||||
+module_param(packetsize, int, 0644);
|
||||
+MODULE_PARM_DESC(packetsize, "Override the RX URB packet size");
|
||||
+
|
||||
static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
u32 *data)
|
||||
{
|
||||
@@ -934,13 +938,13 @@ static int smsc95xx_reset(struct usbnet *dev)
|
||||
|
||||
if (!turbo_mode) {
|
||||
burst_cap = 0;
|
||||
- dev->rx_urb_size = MAX_SINGLE_PACKET_SIZE;
|
||||
+ dev->rx_urb_size = packetsize ? packetsize : MAX_SINGLE_PACKET_SIZE;
|
||||
} else if (dev->udev->speed == USB_SPEED_HIGH) {
|
||||
- burst_cap = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE;
|
||||
- dev->rx_urb_size = DEFAULT_HS_BURST_CAP_SIZE;
|
||||
+ dev->rx_urb_size = packetsize ? packetsize : DEFAULT_HS_BURST_CAP_SIZE;
|
||||
+ burst_cap = dev->rx_urb_size / HS_USB_PKT_SIZE;
|
||||
} else {
|
||||
- burst_cap = DEFAULT_FS_BURST_CAP_SIZE / FS_USB_PKT_SIZE;
|
||||
- dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
|
||||
+ dev->rx_urb_size = packetsize ? packetsize : DEFAULT_FS_BURST_CAP_SIZE;
|
||||
+ burst_cap = dev->rx_urb_size / FS_USB_PKT_SIZE;
|
||||
}
|
||||
|
||||
netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
From 19b27c7a61c48fa37510f73b4f6c065a5dabca2c Mon Sep 17 00:00:00 2001
|
||||
From: popcornmix <popcornmix@gmail.com>
|
||||
Date: Tue, 26 Mar 2013 17:26:38 +0000
|
||||
Subject: [PATCH 084/726] Allow mac address to be set in smsc95xx
|
||||
|
||||
Signed-off-by: popcornmix <popcornmix@gmail.com>
|
||||
|
||||
SQUASH: smsc95xx: Use dev_mod_addr to set MAC addr
|
||||
|
||||
Since adeef3e32146 ("net: constify netdev->dev_addr") it has been
|
||||
illegal to write to the dev_addr MAC address field. Later commits
|
||||
have added explicit checks that it hasn't been modified by nefarious
|
||||
means. The dev_addr_mod helper function is the accepted way to change
|
||||
the dev_addr field, so use it.
|
||||
|
||||
Squash with 96c1def63ee1 ("Allow mac address to be set in smsc95xx").
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/net/usb/smsc95xx.c | 54 ++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 54 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
|
||||
index 89490cc451ac..caebb97289ea 100644
|
||||
--- a/drivers/net/usb/smsc95xx.c
|
||||
+++ b/drivers/net/usb/smsc95xx.c
|
||||
@@ -87,6 +87,10 @@ static int packetsize = 2560;
|
||||
module_param(packetsize, int, 0644);
|
||||
MODULE_PARM_DESC(packetsize, "Override the RX URB packet size");
|
||||
|
||||
+static char *macaddr = ":";
|
||||
+module_param(macaddr, charp, 0);
|
||||
+MODULE_PARM_DESC(macaddr, "MAC address");
|
||||
+
|
||||
static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
|
||||
u32 *data)
|
||||
{
|
||||
@@ -807,6 +811,52 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
|
||||
return phy_mii_ioctl(netdev->phydev, rq, cmd);
|
||||
}
|
||||
|
||||
+/* Check the macaddr module parameter for a MAC address */
|
||||
+static int smsc95xx_is_macaddr_param(struct usbnet *dev, struct net_device *nd)
|
||||
+{
|
||||
+ int i, j, got_num, num;
|
||||
+ u8 mtbl[ETH_ALEN];
|
||||
+
|
||||
+ if (macaddr[0] == ':')
|
||||
+ return 0;
|
||||
+
|
||||
+ i = 0;
|
||||
+ j = 0;
|
||||
+ num = 0;
|
||||
+ got_num = 0;
|
||||
+ while (j < ETH_ALEN) {
|
||||
+ if (macaddr[i] && macaddr[i] != ':') {
|
||||
+ got_num++;
|
||||
+ if ('0' <= macaddr[i] && macaddr[i] <= '9')
|
||||
+ num = num * 16 + macaddr[i] - '0';
|
||||
+ else if ('A' <= macaddr[i] && macaddr[i] <= 'F')
|
||||
+ num = num * 16 + 10 + macaddr[i] - 'A';
|
||||
+ else if ('a' <= macaddr[i] && macaddr[i] <= 'f')
|
||||
+ num = num * 16 + 10 + macaddr[i] - 'a';
|
||||
+ else
|
||||
+ break;
|
||||
+ i++;
|
||||
+ } else if (got_num == 2) {
|
||||
+ mtbl[j++] = (u8) num;
|
||||
+ num = 0;
|
||||
+ got_num = 0;
|
||||
+ i++;
|
||||
+ } else {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (j == ETH_ALEN) {
|
||||
+ netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: "
|
||||
+ "%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2],
|
||||
+ mtbl[3], mtbl[4], mtbl[5]);
|
||||
+ dev_addr_mod(nd, 0, mtbl, ETH_ALEN);
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void smsc95xx_init_mac_address(struct usbnet *dev)
|
||||
{
|
||||
u8 addr[ETH_ALEN];
|
||||
@@ -830,6 +880,10 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Check module parameters */
|
||||
+ if (smsc95xx_is_macaddr_param(dev, dev->net))
|
||||
+ return;
|
||||
+
|
||||
/* no useful static MAC address found. generate a random one */
|
||||
eth_hw_addr_random(dev->net);
|
||||
netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
From 28aec65bb1743c9bfa53b036999f9835c889704e Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Mon, 27 Nov 2017 17:14:54 +0000
|
||||
Subject: [PATCH 085/726] cgroup: Disable cgroup "memory" by default
|
||||
|
||||
Some Raspberry Pis have limited RAM and most users won't use the
|
||||
cgroup memory support so it is disabled by default. Enable with:
|
||||
|
||||
cgroup_enable=memory
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/1950
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
kernel/cgroup/cgroup.c | 38 ++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 38 insertions(+)
|
||||
|
||||
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
|
||||
index 2319946715e0..0bd2f8acde59 100644
|
||||
--- a/kernel/cgroup/cgroup.c
|
||||
+++ b/kernel/cgroup/cgroup.c
|
||||
@@ -6046,6 +6046,9 @@ int __init cgroup_init_early(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static u16 cgroup_enable_mask __initdata;
|
||||
+static int __init cgroup_disable(char *str);
|
||||
+
|
||||
/**
|
||||
* cgroup_init - cgroup initialization
|
||||
*
|
||||
@@ -6079,6 +6082,12 @@ int __init cgroup_init(void)
|
||||
|
||||
mutex_unlock(&cgroup_mutex);
|
||||
|
||||
+ /*
|
||||
+ * Apply an implicit disable, knowing that an explicit enable will
|
||||
+ * prevent if from doing anything.
|
||||
+ */
|
||||
+ cgroup_disable("memory");
|
||||
+
|
||||
for_each_subsys(ss, ssid) {
|
||||
if (ss->early_init) {
|
||||
struct cgroup_subsys_state *css =
|
||||
@@ -6717,6 +6726,10 @@ static int __init cgroup_disable(char *str)
|
||||
strcmp(token, ss->legacy_name))
|
||||
continue;
|
||||
|
||||
+ /* An explicit cgroup_enable overrides a disable */
|
||||
+ if (cgroup_enable_mask & (1 << i))
|
||||
+ continue;
|
||||
+
|
||||
static_branch_disable(cgroup_subsys_enabled_key[i]);
|
||||
pr_info("Disabling %s control group subsystem\n",
|
||||
ss->name);
|
||||
@@ -6735,6 +6748,31 @@ static int __init cgroup_disable(char *str)
|
||||
}
|
||||
__setup("cgroup_disable=", cgroup_disable);
|
||||
|
||||
+static int __init cgroup_enable(char *str)
|
||||
+{
|
||||
+ struct cgroup_subsys *ss;
|
||||
+ char *token;
|
||||
+ int i;
|
||||
+
|
||||
+ while ((token = strsep(&str, ",")) != NULL) {
|
||||
+ if (!*token)
|
||||
+ continue;
|
||||
+
|
||||
+ for_each_subsys(ss, i) {
|
||||
+ if (strcmp(token, ss->name) &&
|
||||
+ strcmp(token, ss->legacy_name))
|
||||
+ continue;
|
||||
+
|
||||
+ cgroup_enable_mask |= 1 << i;
|
||||
+ static_branch_enable(cgroup_subsys_enabled_key[i]);
|
||||
+ pr_info("Enabling %s control group subsystem\n",
|
||||
+ ss->name);
|
||||
+ }
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+__setup("cgroup_enable=", cgroup_enable);
|
||||
+
|
||||
void __init __weak enable_debug_cgroup(void) { }
|
||||
|
||||
static int __init enable_cgroup_debug(char *str)
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From 412a2c6467fd7f15a7c29f5a287556ec5c22f779 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Fri, 13 Mar 2015 12:43:36 +0000
|
||||
Subject: [PATCH 086/726] Protect __release_resource against resources without
|
||||
parents
|
||||
|
||||
Without this patch, removing a device tree overlay can crash here.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
kernel/resource.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/kernel/resource.c b/kernel/resource.c
|
||||
index 1aeeededdd4c..7fb4f2338345 100644
|
||||
--- a/kernel/resource.c
|
||||
+++ b/kernel/resource.c
|
||||
@@ -200,6 +200,12 @@ static int __release_resource(struct resource *old, bool release_child)
|
||||
{
|
||||
struct resource *tmp, **p, *chd;
|
||||
|
||||
+ if (!old->parent) {
|
||||
+ WARN(old->sibling, "sibling but no parent");
|
||||
+ if (old->sibling)
|
||||
+ return -EINVAL;
|
||||
+ return 0;
|
||||
+ }
|
||||
p = &old->parent->child;
|
||||
for (;;) {
|
||||
tmp = *p;
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From 180599963c7f12ca70b31329a890ae453f666fc0 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Thu, 9 Feb 2017 14:33:30 +0000
|
||||
Subject: [PATCH 087/726] irq-bcm2836: Avoid "Invalid trigger warning"
|
||||
|
||||
Initialise the level for each IRQ to avoid a warning from the
|
||||
arm arch timer code.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
---
|
||||
drivers/irqchip/irq-bcm2836.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
|
||||
index 51491c3c6fdd..d8d61a136225 100644
|
||||
--- a/drivers/irqchip/irq-bcm2836.c
|
||||
+++ b/drivers/irqchip/irq-bcm2836.c
|
||||
@@ -128,7 +128,7 @@ static int bcm2836_map(struct irq_domain *d, unsigned int irq,
|
||||
irq_set_percpu_devid(irq);
|
||||
irq_domain_set_info(d, irq, hw, chip, d->host_data,
|
||||
handle_percpu_devid_irq, NULL, NULL);
|
||||
- irq_set_status_flags(irq, IRQ_NOAUTOEN);
|
||||
+ irq_set_status_flags(irq, IRQ_NOAUTOEN | IRQ_TYPE_LEVEL_LOW);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
From c0aead8adbef831d330ae34dc4c715302112f2c2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
|
||||
Date: Fri, 12 Jun 2015 19:01:05 +0200
|
||||
Subject: [PATCH 088/726] irqchip: bcm2835: Add FIQ support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Add a duplicate irq range with an offset on the hwirq's so the
|
||||
driver can detect that enable_fiq() is used.
|
||||
Tested with downstream dwc_otg USB controller driver.
|
||||
|
||||
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
||||
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||||
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
|
||||
---
|
||||
arch/arm/mach-bcm/Kconfig | 1 +
|
||||
drivers/irqchip/irq-bcm2835.c | 51 +++++++++++++++++++++++++++++++----
|
||||
2 files changed, 47 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
|
||||
index 8789d93a7c04..4b2000d9ad05 100644
|
||||
--- a/arch/arm/mach-bcm/Kconfig
|
||||
+++ b/arch/arm/mach-bcm/Kconfig
|
||||
@@ -159,6 +159,7 @@ config ARCH_BCM2835
|
||||
select ARM_TIMER_SP804
|
||||
select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
|
||||
select BCM2835_TIMER
|
||||
+ select FIQ
|
||||
select PINCTRL
|
||||
select PINCTRL_BCM2835
|
||||
select MFD_CORE
|
||||
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
|
||||
index e94e2882286c..c593c4020b61 100644
|
||||
--- a/drivers/irqchip/irq-bcm2835.c
|
||||
+++ b/drivers/irqchip/irq-bcm2835.c
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <asm/exception.h>
|
||||
|
||||
/* Put the bank and irq (32 bits) into the hwirq */
|
||||
-#define MAKE_HWIRQ(b, n) ((b << 5) | (n))
|
||||
+#define MAKE_HWIRQ(b, n) (((b) << 5) | (n))
|
||||
#define HWIRQ_BANK(i) (i >> 5)
|
||||
#define HWIRQ_BIT(i) BIT(i & 0x1f)
|
||||
|
||||
@@ -62,9 +62,13 @@
|
||||
|
||||
#define REG_FIQ_CONTROL 0x0c
|
||||
#define FIQ_CONTROL_ENABLE BIT(7)
|
||||
+#define REG_FIQ_ENABLE FIQ_CONTROL_ENABLE
|
||||
+#define REG_FIQ_DISABLE 0
|
||||
|
||||
#define NR_BANKS 3
|
||||
#define IRQS_PER_BANK 32
|
||||
+#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
|
||||
+#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
|
||||
|
||||
static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
|
||||
static const int reg_enable[] __initconst = { 0x18, 0x10, 0x14 };
|
||||
@@ -89,14 +93,38 @@ static void __exception_irq_entry bcm2835_handle_irq(
|
||||
struct pt_regs *regs);
|
||||
static void bcm2836_chained_handle_irq(struct irq_desc *desc);
|
||||
|
||||
+static inline unsigned int hwirq_to_fiq(unsigned long hwirq)
|
||||
+{
|
||||
+ hwirq -= NUMBER_IRQS;
|
||||
+ /*
|
||||
+ * The hwirq numbering used in this driver is:
|
||||
+ * BASE (0-7) GPU1 (32-63) GPU2 (64-95).
|
||||
+ * This differ from the one used in the FIQ register:
|
||||
+ * GPU1 (0-31) GPU2 (32-63) BASE (64-71)
|
||||
+ */
|
||||
+ if (hwirq >= 32)
|
||||
+ return hwirq - 32;
|
||||
+
|
||||
+ return hwirq + 64;
|
||||
+}
|
||||
+
|
||||
static void armctrl_mask_irq(struct irq_data *d)
|
||||
{
|
||||
- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.disable[HWIRQ_BANK(d->hwirq)]);
|
||||
+ if (d->hwirq >= NUMBER_IRQS)
|
||||
+ writel_relaxed(REG_FIQ_DISABLE, intc.base + REG_FIQ_CONTROL);
|
||||
+ else
|
||||
+ writel_relaxed(HWIRQ_BIT(d->hwirq),
|
||||
+ intc.disable[HWIRQ_BANK(d->hwirq)]);
|
||||
}
|
||||
|
||||
static void armctrl_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.enable[HWIRQ_BANK(d->hwirq)]);
|
||||
+ if (d->hwirq >= NUMBER_IRQS)
|
||||
+ writel_relaxed(REG_FIQ_ENABLE | hwirq_to_fiq(d->hwirq),
|
||||
+ intc.base + REG_FIQ_CONTROL);
|
||||
+ else
|
||||
+ writel_relaxed(HWIRQ_BIT(d->hwirq),
|
||||
+ intc.enable[HWIRQ_BANK(d->hwirq)]);
|
||||
}
|
||||
|
||||
static struct irq_chip armctrl_chip = {
|
||||
@@ -142,8 +170,9 @@ static int __init armctrl_of_init(struct device_node *node,
|
||||
if (!base)
|
||||
panic("%pOF: unable to map IC registers\n", node);
|
||||
|
||||
- intc.domain = irq_domain_add_linear(node, MAKE_HWIRQ(NR_BANKS, 0),
|
||||
- &armctrl_ops, NULL);
|
||||
+ intc.base = base;
|
||||
+ intc.domain = irq_domain_add_linear(node, NUMBER_IRQS * 2,
|
||||
+ &armctrl_ops, NULL);
|
||||
if (!intc.domain)
|
||||
panic("%pOF: unable to create IRQ domain\n", node);
|
||||
|
||||
@@ -186,6 +215,18 @@ static int __init armctrl_of_init(struct device_node *node,
|
||||
set_handle_irq(bcm2835_handle_irq);
|
||||
}
|
||||
|
||||
+ /* Make a duplicate irq range which is used to enable FIQ */
|
||||
+ for (b = 0; b < NR_BANKS; b++) {
|
||||
+ for (i = 0; i < bank_irqs[b]; i++) {
|
||||
+ irq = irq_create_mapping(intc.domain,
|
||||
+ MAKE_HWIRQ(b, i) + NUMBER_IRQS);
|
||||
+ BUG_ON(irq <= 0);
|
||||
+ irq_set_chip(irq, &armctrl_chip);
|
||||
+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
|
||||
+ }
|
||||
+ }
|
||||
+ init_FIQ(FIQ_START);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.1
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
From 69f1bf3c3c5e8fec2e8d4af4eab4c22392b4daf1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
|
||||
Date: Fri, 23 Oct 2015 16:26:55 +0200
|
||||
Subject: [PATCH 089/726] irqchip: irq-bcm2835: Add 2836 FIQ support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
||||
---
|
||||
drivers/irqchip/irq-bcm2835.c | 43 +++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
|
||||
index c593c4020b61..71994904a3c7 100644
|
||||
--- a/drivers/irqchip/irq-bcm2835.c
|
||||
+++ b/drivers/irqchip/irq-bcm2835.c
|
||||
@@ -41,8 +41,11 @@
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/irqchip.h>
|
||||
#include <linux/irqdomain.h>
|
||||
+#include <linux/mfd/syscon.h>
|
||||
+#include <linux/regmap.h>
|
||||
|
||||
#include <asm/exception.h>
|
||||
+#include <asm/mach/irq.h>
|
||||
|
||||
/* Put the bank and irq (32 bits) into the hwirq */
|
||||
#define MAKE_HWIRQ(b, n) (((b) << 5) | (n))
|
||||
@@ -60,6 +63,9 @@
|
||||
#define BANK0_VALID_MASK (BANK0_HWIRQ_MASK | BANK1_HWIRQ | BANK2_HWIRQ \
|
||||
| SHORTCUT1_MASK | SHORTCUT2_MASK)
|
||||
|
||||
+#undef ARM_LOCAL_GPU_INT_ROUTING
|
||||
+#define ARM_LOCAL_GPU_INT_ROUTING 0x0c
|
||||
+
|
||||
#define REG_FIQ_CONTROL 0x0c
|
||||
#define FIQ_CONTROL_ENABLE BIT(7)
|
||||
#define REG_FIQ_ENABLE FIQ_CONTROL_ENABLE
|
||||
@@ -86,6 +92,7 @@ struct armctrl_ic {
|
||||
void __iomem *enable[NR_BANKS];
|
||||
void __iomem *disable[NR_BANKS];
|
||||
struct irq_domain *domain;
|
||||
+ struct regmap *local_regmap;
|
||||
};
|
||||
|
||||
static struct armctrl_ic intc __read_mostly;
|
||||
@@ -119,12 +126,35 @@ static void armctrl_mask_irq(struct irq_data *d)
|
||||
|
||||
static void armctrl_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
- if (d->hwirq >= NUMBER_IRQS)
|
||||
+ if (d->hwirq >= NUMBER_IRQS) {
|
||||
+ if (num_online_cpus() > 1) {
|
||||
+ unsigned int data;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!intc.local_regmap) {
|
||||
+ pr_err("FIQ is disabled due to missing regmap\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ret = regmap_read(intc.local_regmap,
|
||||
+ ARM_LOCAL_GPU_INT_ROUTING, &data);
|
||||
+ if (ret) {
|
||||
+ pr_err("Failed to read int routing %d\n", ret);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ data &= ~0xc;
|
||||
+ data |= (1 << 2);
|
||||
+ regmap_write(intc.local_regmap,
|
||||
+ ARM_LOCAL_GPU_INT_ROUTING, data);
|
||||
+ }
|
||||
+
|
||||
writel_relaxed(REG_FIQ_ENABLE | hwirq_to_fiq(d->hwirq),
|
||||
intc.base + REG_FIQ_CONTROL);
|
||||
- else
|
||||
+ } else {
|
||||
writel_relaxed(HWIRQ_BIT(d->hwirq),
|
||||
intc.enable[HWIRQ_BANK(d->hwirq)]);
|
||||
+ }
|
||||
}
|
||||
|
||||
static struct irq_chip armctrl_chip = {
|
||||
@@ -215,6 +245,15 @@ static int __init armctrl_of_init(struct device_node *node,
|
||||
set_handle_irq(bcm2835_handle_irq);
|
||||
}
|
||||
|
||||
+ if (is_2836) {
|
||||
+ intc.local_regmap =
|
||||
+ syscon_regmap_lookup_by_compatible("brcm,bcm2836-arm-local");
|
||||
+ if (IS_ERR(intc.local_regmap)) {
|
||||
+ pr_err("Failed to get local register map. FIQ is disabled for cpus > 1\n");
|
||||
+ intc.local_regmap = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Make a duplicate irq range which is used to enable FIQ */
|
||||
for (b = 0; b < NR_BANKS; b++) {
|
||||
for (i = 0; i < bank_irqs[b]; i++) {
|
||||
--
|
||||
2.33.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue