Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ae4cb17 authored by Shivendra Kakrania's avatar Shivendra Kakrania
Browse files

techpack: video: Video driver kernel project initial snapshot



This change brings msm vidc driver from base 4.19 kernel project.
It is the first source code snapshot from base kernel project.

Change-Id: I1d600c4e9459b9013f4b607890c52644f6d94f0c
Signed-off-by: default avatarShivendra Kakrania <shiven@codeaurora.org>
parent 623f36a9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -Wno-unused-function
obj-y := vid.o

# auto-detect subdirs
ifeq ($(CONFIG_ARCH_KONA), y)
include $(srctree)/techpack/video/config/konavid.conf
endif

ifeq ($(CONFIG_ARCH_KONA), y)
LINUXINCLUDE    += -include $(srctree)/techpack/video/config/konavidconf.h
endif

obj-y +=msm/

config/konavid.conf

0 → 100644
+1 −0
Original line number Diff line number Diff line
export CONFIG_MSM_VIDC_V4L2=y

config/konavidconf.h

0 → 100644
+6 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 */

#define CONFIG_MSM_VIDC_V4L2 1 

msm/Makefile

0 → 100644
+27 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y += -I$(srctree)/techpack/video/msm/vidc/ \
    -I$(srctree)/drivers/devfreq/

msm-vidc-objs := vidc/msm_v4l2_vidc.o \
                vidc/msm_v4l2_private.o \
                vidc/msm_vidc_platform.o \
                vidc/msm_vidc_common.o \
                vidc/msm_vidc.o \
                vidc/msm_vdec.o \
                vidc/msm_venc.o \
                vidc/msm_cvp_internal.o \
                vidc/msm_cvp_external.o \
                vidc/msm_smem.o \
                vidc/msm_vidc_debug.o \
                vidc/msm_vidc_res_parse.o \
                vidc/venus_hfi.o \
                vidc/hfi_response_handler.o \
                vidc/hfi_packetization.o \
                vidc/vidc_hfi.o \
                vidc/msm_vidc_clocks.o \
                vidc/msm_vidc_bus_iris1.o \
                vidc/msm_vidc_bus_iris2.o \
                vidc/msm_vidc_buffer_calculations.o

obj-$(CONFIG_MSM_VIDC_V4L2) := msm-vidc.o

msm/vidc/fixedpoint.h

0 → 100644
+68 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 */

#ifdef _FIXP_ARITH_H
#error "This implementation is meant to override fixp-arith.h, don't use both"
#endif

#ifndef _FIXEDPOINT_H_
#define _FIXEDPOINT_H_

#include <linux/types.h>
#include <linux/bits.h>

/*
 * Normally would typedef'ed, but checkpatch doesn't like typedef.
 * Also should be normally typedef'ed to intmax_t but that doesn't seem to be
 * available in the kernel
 */
#define fp_t size_t

/* (Arbitrarily) make the first 25% of the bits to be the fractional bits */
#define FP_FRACTIONAL_BITS ((sizeof(fp_t) * 8) / 4)

#define FP(__i, __f_n, __f_d) \
	((((fp_t)(__i)) << FP_FRACTIONAL_BITS) + \
	(((__f_n) << FP_FRACTIONAL_BITS) / (__f_d)))

#define FP_INT(__i) FP(__i, 0, 1)
#define FP_ONE FP_INT(1)
#define FP_ZERO FP_INT(0)

static inline size_t fp_frac_base(void)
{
	return GENMASK(FP_FRACTIONAL_BITS - 1, 0);
}

static inline size_t fp_frac(fp_t a)
{
	return a & GENMASK(FP_FRACTIONAL_BITS - 1, 0);
}

static inline size_t fp_int(fp_t a)
{
	return a >> FP_FRACTIONAL_BITS;
}

static inline size_t fp_round(fp_t a)
{
	/* is the fractional part >= frac_max / 2? */
	bool round_up = fp_frac(a) >= fp_frac_base() / 2;

	return fp_int(a) + round_up;
}

static inline fp_t fp_mult(fp_t a, fp_t b)
{
	return (a * b) >> FP_FRACTIONAL_BITS;
}


static inline fp_t fp_div(fp_t a, fp_t b)
{
	return (a << FP_FRACTIONAL_BITS) / b;
}

#endif
Loading