summaryrefslogtreecommitdiffstats
path: root/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm')
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm.bb102
-rw-r--r--bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm/0001-Set-UDS-horizontal-scaling-phase-to-auto.patch40
2 files changed, 142 insertions, 0 deletions
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm.bb b/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm.bb
new file mode 100644
index 00000000..9b723614
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm.bb
@@ -0,0 +1,102 @@
+DESCRIPTION = "VSP Manager for the R-Car Gen3"
+
+require include/rcar-gen3-modules-common.inc
+
+LICENSE = "GPLv2 & MIT"
+LIC_FILES_CHKSUM = " \
+ file://GPL-COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://MIT-COPYING;md5=0ebf15a927e436cec699371cd890775c \
+"
+
+inherit module
+
+DEPENDS = "linux-renesas"
+PN = "kernel-module-vspm"
+PR = "r0"
+
+VSPM_DRV_URL = "git://github.com/renesas-rcar/vspm_drv.git"
+BRANCH = "rcar_gen3"
+SRCREV = "7f854a9a1c4760255a54b7c14891d1545ed1bf43"
+
+SRC_URI = "${VSPM_DRV_URL};branch=${BRANCH}"
+
+# Fix patch for upscaling issue
+SRC_URI_append = " \
+ file://0001-Set-UDS-horizontal-scaling-phase-to-auto.patch \
+"
+
+S = "${WORKDIR}/git"
+VSPM_DRV_DIR = "vspm-module/files/vspm"
+includedir = "${RENESAS_DATADIR}/include"
+
+# Build VSP Manager kernel module without suffix
+KERNEL_MODULE_PACKAGE_SUFFIX = ""
+
+do_compile() {
+ cd ${S}/${VSPM_DRV_DIR}/drv
+ make all
+}
+
+do_install () {
+ # Create destination directories
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/extra/
+ install -d ${KERNELSRC}/include
+ install -d ${D}/${includedir}
+
+ # Install shared library to KERNELSRC(STAGING_KERNEL_DIR) for reference from other modules
+ # This file installed in SDK by kernel-devsrc pkg.
+ install -m 644 ${S}/${VSPM_DRV_DIR}/drv/Module.symvers ${KERNELSRC}/include/vspm.symvers
+
+ # Install kernel module
+ install -m 644 ${S}/${VSPM_DRV_DIR}/drv/vspm.ko ${D}/lib/modules/${KERNEL_VERSION}/extra/
+
+ # Install shared header files to KERNELSRC(STAGING_KERNEL_DIR)
+ # This file installed in SDK by kernel-devsrc pkg.
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/vspm_public.h ${KERNELSRC}/include/
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/vspm_cmn.h ${KERNELSRC}/include/
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/vsp_drv.h ${KERNELSRC}/include/
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/fdp_drv.h ${KERNELSRC}/include/
+
+ # Install shared header files
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/vspm_cmn.h ${D}/${includedir}/
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/vsp_drv.h ${D}/${includedir}/
+ install -m 644 ${S}/${VSPM_DRV_DIR}/include/fdp_drv.h ${D}/${includedir}/
+}
+
+do_populate_sysroot[sstate-inputdirs] += "${S}/${VSPM_DRV_DIR}/include/"
+do_populate_sysroot[sstate-outputdirs] += "${KERNELSRC}/include/"
+do_populate_sysroot_setscene[prefuncs] = "vspm_sstate_check_func"
+SSTATE_DUPWHITELIST = "${KERNELSRC}/include"
+
+vspm_sstate_check_func() {
+ # An error is returned when unpack of kernel source has not been completed yet.
+ # By returning error, rebuild task runs by force (Invalidating sstate).
+ # This module installs shared header files in ${KERNELSRC}/include by
+ # sstate cache.
+ # Those files will be deleted by unpack task of kernel.
+ if [ ${WITHIN_EXT_SDK} -eq 1 ]; then
+ :
+ else
+ if [ ! -d "${KERNELSRC}/include" ]; then
+ exit 1
+ fi
+ fi
+}
+
+# Should also clean deploy/licenses directory
+# for module when do_clean.
+do_clean[cleandirs] += "${LICENSE_DIRECTORY}/${PN}"
+
+PACKAGES = " \
+ ${PN} \
+ ${PN}-dev \
+"
+
+FILES_${PN} = " \
+ /lib/modules/${KERNEL_VERSION}/extra/vspm.ko \
+"
+
+RPROVIDES_${PN} += "kernel-module-vspm"
+
+# Autoload VSPM
+KERNEL_MODULE_AUTOLOAD_append = " vspm"
diff --git a/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm/0001-Set-UDS-horizontal-scaling-phase-to-auto.patch b/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm/0001-Set-UDS-horizontal-scaling-phase-to-auto.patch
new file mode 100644
index 00000000..17bf6233
--- /dev/null
+++ b/bsp/meta-renesas/meta-rcar-gen3/recipes-kernel/kernel-module-vspm/kernel-module-vspm/0001-Set-UDS-horizontal-scaling-phase-to-auto.patch
@@ -0,0 +1,40 @@
+From dd7dffa07065100c3164ca94a1d4395712e647cd Mon Sep 17 00:00:00 2001
+From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
+Date: Mon, 3 Jun 2019 12:33:57 +0900
+Subject: [PATCH] Set UDS horizontal scaling phase to auto
+
+Use the register default settings for the scaling phase instead
+of manually calculating them.
+
+The default setting seems to calculate the phase correctly,
+which the manual settings seem to shift the output image to the left
+my an amount proportional to the scaling ratio. i.e x16 scaling
+will shift the output by 16 pixels.
+---
+ vspm-module/files/vspm/drv/vsp/vsp_drv_phy.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/vspm-module/files/vspm/drv/vsp/vsp_drv_phy.c b/vspm-module/files/vspm/drv/vsp/vsp_drv_phy.c
+index 8f63565..6f89bae 100644
+--- a/vspm-module/files/vspm/drv/vsp/vsp_drv_phy.c
++++ b/vspm-module/files/vspm/drv/vsp/vsp_drv_phy.c
+@@ -1454,16 +1454,6 @@ static void vsp_ins_replace_part_uds_module(
+ r_temp *= ratio;
+ }
+
+- /* add horizontal filter phase of control register */
+- uds_info->val_ctrl |= VSP_UDS_CTRL_AMDSLH;
+-
+- /* replace scaling filter horizontal phase */
+- if (l_temp & 0xfff)
+- uds_info->val_hphase = (4096 - (l_temp & 0xfff)) << 16;
+- else
+- uds_info->val_hphase = 0;
+- if (r_temp & 0xfff)
+- uds_info->val_hphase |= (4096 - (r_temp & 0xfff));
+ } else {
+ l_temp *= 4096;
+ r_temp *= 4096;
+--
+2.17.1
+