mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
picdec: initial add the driver
PD#149244: initial add the driver 1.Add amlogic picture decoder driver; 2.device tree of picdec for p212/p230/p231/q200/skt; 3.related Makefiles/Kconfig/Headfiles update; Change-Id: Ida1d223ac0f976d601d912bc3dce6473d9d3bf86 Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
This commit is contained in:
12
MAINTAINERS
12
MAINTAINERS
@@ -13480,6 +13480,10 @@ AMLOGIC driver for memory extend
|
||||
M: Tao Zeng <tao.zeng@amlogic.com>
|
||||
F: drivers/amlogic/memory_ext/*
|
||||
|
||||
AMLOGIC driver for memory extend
|
||||
M: Tao Zeng <tao.zeng@amlogic.com>
|
||||
F: drivers/amlogic/memory_ext/*
|
||||
|
||||
AMLOGIC driver for pmu
|
||||
M: Tao Zeng <tao.zeng@amlogic.com>
|
||||
F: drivers/amlogic/power/*
|
||||
@@ -14099,4 +14103,10 @@ F: drivers/amlogic/input/keyboard/*
|
||||
|
||||
AMLOGIC ION_DEV ADD CODEC_MM
|
||||
M: JinTao Xu <jintao.xu@amlogic.com>
|
||||
F: drivers/staging/android/ion/ion_codec_mm_heap.c
|
||||
F: drivers/staging/android/ion/ion_codec_mm_heap.c
|
||||
|
||||
AMLOGIC PICTURE DECODER DRIVER
|
||||
M: Guosong Zhou <guosong.zhou@amlogic.com>
|
||||
F: drivers/amlogic/media/video_processor/Kconfig
|
||||
F: drivers/amlogic/media/video_processor/Makefile
|
||||
F: drivers/amlogic/media/video_processor/pic_dev/*
|
||||
|
||||
@@ -928,6 +928,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -938,6 +938,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -914,6 +914,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -854,6 +854,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -854,6 +854,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -982,6 +982,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
memory-region = <&ppmgr_reserved>;
|
||||
|
||||
@@ -941,6 +941,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
|
||||
@@ -815,6 +815,13 @@
|
||||
interrupt-names = "rdma";
|
||||
};
|
||||
|
||||
picdec {
|
||||
compatible = "amlogic, picdec";
|
||||
memory-region = <&picdec_cma_reserved>;
|
||||
dev_name = "picdec";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ppmgr {
|
||||
compatible = "amlogic, ppmgr";
|
||||
memory-region = <&ppmgr_reserved>;
|
||||
|
||||
@@ -282,6 +282,7 @@ CONFIG_AMLOGIC_POST_PROCESS_MANAGER=y
|
||||
CONFIG_AMLOGIC_POST_PROCESS_MANAGER_PPSCALER=y
|
||||
CONFIG_AMLOGIC_VIDEOBUF2_ION=y
|
||||
CONFIG_AMLOGIC_IONVIDEO=y
|
||||
CONFIG_AMLOGIC_PIC_DEC=y
|
||||
CONFIG_AMLOGIC_MEDIA_ENHANCEMENT=y
|
||||
CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_VECM=y
|
||||
CONFIG_AMLOGIC_MMC=y
|
||||
|
||||
@@ -16,6 +16,7 @@ if AMLOGIC_MEDIA_VIDEO_PROCESSOR
|
||||
source "drivers/amlogic/media/video_processor/video_dev/Kconfig"
|
||||
source "drivers/amlogic/media/video_processor/ppmgr/Kconfig"
|
||||
source "drivers/amlogic/media/video_processor/ionvideo/Kconfig"
|
||||
source "drivers/amlogic/media/video_processor/pic_dev/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
obj-$(CONFIG_AMLOGIC_V4L_VIDEO2) += video_dev/
|
||||
obj-$(CONFIG_AMLOGIC_POST_PROCESS_MANAGER) += ppmgr/
|
||||
obj-$(CONFIG_AMLOGIC_IONVIDEO) += ionvideo/
|
||||
obj-$(CONFIG_AMLOGIC_PIC_DEC) += pic_dev/
|
||||
|
||||
14
drivers/amlogic/media/video_processor/pic_dev/Kconfig
Normal file
14
drivers/amlogic/media/video_processor/pic_dev/Kconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Amlogic picture decoder device configuation
|
||||
#
|
||||
|
||||
menu "Amlogic picture decoder support"
|
||||
|
||||
config AMLOGIC_PIC_DEC
|
||||
tristate "Amlogic picture decoder"
|
||||
default n
|
||||
select AM_PTSSERVER
|
||||
help
|
||||
Driver for picture decoder.
|
||||
|
||||
endmenu
|
||||
5
drivers/amlogic/media/video_processor/pic_dev/Makefile
Normal file
5
drivers/amlogic/media/video_processor/pic_dev/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Makefile for the amlogic picture decoder device driver.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_AMLOGIC_PIC_DEC) += picdec.o
|
||||
1826
drivers/amlogic/media/video_processor/pic_dev/picdec.c
Normal file
1826
drivers/amlogic/media/video_processor/pic_dev/picdec.c
Normal file
File diff suppressed because it is too large
Load Diff
114
drivers/amlogic/media/video_processor/pic_dev/picdec.h
Normal file
114
drivers/amlogic/media/video_processor/pic_dev/picdec.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* drivers/amlogic/media/video_processor/pic_dev/picdec.h
|
||||
*
|
||||
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PICDEC_INCLUDE__
|
||||
#define _PICDEC_INCLUDE__
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
/* #include <mach/am_regs.h> */
|
||||
#include <linux/amlogic/media/canvas/canvas.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/io-mapping.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/dma-contiguous.h>
|
||||
/**************************************************************
|
||||
*
|
||||
* macro define
|
||||
*
|
||||
**************************************************************
|
||||
*/
|
||||
|
||||
struct picdec_device_s {
|
||||
char name[20];
|
||||
struct platform_device *pdev;
|
||||
int task_running;
|
||||
int dump;
|
||||
char *dump_path;
|
||||
unsigned int open_count;
|
||||
int major;
|
||||
unsigned int dbg_enable;
|
||||
struct class *cla;
|
||||
struct device *dev;
|
||||
resource_size_t buffer_start;
|
||||
unsigned int buffer_size;
|
||||
resource_size_t assit_buf_start;
|
||||
const struct vinfo_s *vinfo;
|
||||
int disp_width;
|
||||
int disp_height;
|
||||
int origin_width;
|
||||
int origin_height;
|
||||
int frame_render;
|
||||
int frame_post;
|
||||
int target_width;
|
||||
int target_height;
|
||||
int p2p_mode;
|
||||
int output_format_mode;
|
||||
struct ge2d_context_s *context;
|
||||
int cur_index;
|
||||
int use_reserved;
|
||||
struct page *cma_pages;
|
||||
struct io_mapping *mapping;
|
||||
void __iomem *vir_addr;
|
||||
int cma_mode;
|
||||
};
|
||||
|
||||
struct source_input_s {
|
||||
char *input;
|
||||
int frame_width;
|
||||
int frame_height;
|
||||
int format;
|
||||
int rotate;
|
||||
};
|
||||
|
||||
struct compat_source_input_s {
|
||||
compat_uptr_t input;
|
||||
int frame_width;
|
||||
int frame_height;
|
||||
int format;
|
||||
int rotate;
|
||||
};
|
||||
|
||||
#define PICDEC_IOC_MAGIC 'P'
|
||||
#define PICDEC_IOC_FRAME_RENDER _IOW(PICDEC_IOC_MAGIC, 0x00, \
|
||||
struct source_input_s)
|
||||
#define PICDEC_IOC_FRAME_POST _IOW(PICDEC_IOC_MAGIC, 0X01, unsigned int)
|
||||
#define PICDEC_IOC_CONFIG_FRAME _IOW(PICDEC_IOC_MAGIC, 0X02, unsigned int)
|
||||
|
||||
#define PICDEC_IOC_FRAME_RENDER32 _IOW(PICDEC_IOC_MAGIC, 0x00, \
|
||||
struct compat_source_input_s)
|
||||
|
||||
void stop_picdec_task(void);
|
||||
int picdec_buffer_init(void);
|
||||
void get_picdec_buf_info(resource_size_t *start, unsigned int *size,
|
||||
struct io_mapping **mapping);
|
||||
int picdec_fill_buffer(struct vframe_s *vf, struct ge2d_context_s *context,
|
||||
struct config_para_ex_s *ge2d_config);
|
||||
extern void set_freerun_mode(int mode);
|
||||
int picdec_cma_buf_init(void);
|
||||
int picdec_cma_buf_uninit(void);
|
||||
extern int start_picdec_task(void);
|
||||
extern int start_picdec_simulate_task(void);
|
||||
#endif /* _PICDEC_INCLUDE__ */
|
||||
Reference in New Issue
Block a user