linux/drivers/staging/media/meson/vdec/codec_h264.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2019 BayLibre, SAS
 * Author: Maxime Jourdan <[email protected]>
 */

#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-dma-contig.h>

#include "vdec_helpers.h"
#include "dos_regs.h"
#include "codec_h264.h"

#define SIZE_EXT_FW
#define SIZE_WORKSPACE
#define SIZE_SEI

/*
 * Offset added by the firmware which must be substracted
 * from the workspace phyaddr
 */
#define WORKSPACE_BUF_OFFSET

/* ISR status */
#define CMD_MASK
#define CMD_SRC_CHANGE
#define CMD_FRAMES_READY
#define CMD_FATAL_ERROR
#define CMD_BAD_WIDTH
#define CMD_BAD_HEIGHT

#define SEI_DATA_READY

/* Picture type */
#define PIC_TOP_BOT
#define PIC_BOT_TOP

/* Size of Motion Vector per macroblock */
#define MB_MV_SIZE

/* Frame status data */
#define PIC_STRUCT_BIT
#define PIC_STRUCT_MASK
#define BUF_IDX_MASK
#define ERROR_FLAG
#define OFFSET_BIT
#define OFFSET_MASK

/* Bitstream parsed data */
#define MB_TOTAL_BIT
#define MB_TOTAL_MASK
#define MB_WIDTH_MASK
#define MAX_REF_BIT
#define MAX_REF_MASK
#define AR_IDC_BIT
#define AR_IDC_MASK
#define AR_PRESENT_FLAG
#define AR_EXTEND

/*
 * Buffer to send to the ESPARSER to signal End Of Stream for H.264.
 * This is a 16x16 encoded picture that will trigger drain firmware-side.
 * There is no known alternative.
 */
static const u8 eos_sequence[SZ_4K] =;

static const u8 *codec_h264_eos_sequence(u32 *len)
{}

struct codec_h264 {};

static int codec_h264_can_recycle(struct amvdec_core *core)
{}

static void codec_h264_recycle(struct amvdec_core *core, u32 buf_idx)
{}

static int codec_h264_start(struct amvdec_session *sess)
{}

static int codec_h264_stop(struct amvdec_session *sess)
{}

static int codec_h264_load_extended_firmware(struct amvdec_session *sess,
					     const u8 *data, u32 len)
{}

static const struct v4l2_fract par_table[] =;

static void codec_h264_set_par(struct amvdec_session *sess)
{}

static void codec_h264_resume(struct amvdec_session *sess)
{}

/*
 * Configure the H.264 decoder when the parser detected a parameter set change
 */
static void codec_h264_src_change(struct amvdec_session *sess)
{}

/*
 * The bitstream offset is split in half in 2 different registers.
 * Fetch its MSB here, which location depends on the frame number.
 */
static u32 get_offset_msb(struct amvdec_core *core, int frame_num)
{}

static void codec_h264_frames_ready(struct amvdec_session *sess, u32 status)
{}

static irqreturn_t codec_h264_threaded_isr(struct amvdec_session *sess)
{}

static irqreturn_t codec_h264_isr(struct amvdec_session *sess)
{}

struct amvdec_codec_ops codec_h264_ops =;