type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
defines | #define MNT_DETACH 2 |
functions | int try_remount(const char *spec, const char *node)
{
int res;
res = mount(spec, node, NULL,
MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
if (res == 0) {
struct mntent remnt;
nfs_error(_("%s: %s busy - remounted read-only"),
progname, spec);
remnt.mnt_type = remnt.mnt_fsname = NULL;
remnt.mnt_dir =... |
functions | else if (errno != EBUSY) { /* hmm ... */
perror(_("remount"));
nfs_error(_("%s: could not remount %s read-only"),
progname, spec);
} |
functions | int del_mtab(const char *spec, const char *node)
{
int umnt_err, res;
umnt_err = 0;
if (lazy) {
res = umount2 (node, MNT_DETACH);
if (res < 0)
umnt_err = errno;
goto writemtab;
} |
functions | int nfs_umount_do_umnt(struct mount_options *options,
char **hostname, char **dirname)
{
struct sockaddr_storage address;
struct sockaddr *sap = (struct sockaddr *)&address;
socklen_t salen = sizeof(address);
struct pmap nfs_pmap, mnt_pmap;
nfs_options2pmap(options, &nfs_pmap, &mnt_pmap);
*hostname = n... |
functions | int nfs_umount23(const char *devname, char *string)
{
char *hostname, *dirname;
struct mount_options *options;
int result = EX_FAIL;
if (!nfs_parse_devname(devname, &hostname, &dirname))
return EX_USAGE;
options = po_split(string);
if (options) {
result = nfs_umount_do_umnt(options, &hostname, &dirname);
... |
functions | void umount_usage(void)
{
printf(_("usage: %s dir [-fvnrlh]\n"), progname);
printf(_("options:\n\t-f\t\tforce unmount\n"));
printf(_("\t-v\tverbose\n"));
printf(_("\t-n\tDo not update /etc/mtab\n"));
printf(_("\t-r\tremount\n"));
printf(_("\t-l\tlazy unmount\n"));
printf(_("\t-h\tprint this help\n\n"));
} |
functions | int nfsumount(int argc, char *argv[])
{
int c, ret;
char *spec;
struct mntentchn *mc;
if (argc < 2) {
umount_usage();
return EX_USAGE;
} |
functions | else if (*spec != '/') {
if (!lazy)
ret = nfs_umount23(spec, "tcp,v3");
} |
includes |
#include <linux/clk.h> |
includes | #include <linux/irqreturn.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/log2.h> |
includes | #include <linux/platform_device.h> |
includes | #include <linux/reset.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/videodev2.h> |
includes |
#include <media/v4l2-common.h> |
includes | #include <media/v4l2-ctrls.h> |
includes | #include <media/v4l2-fh.h> |
includes | #include <media/v4l2-mem2mem.h> |
includes | #include <media/videobuf2-v4l2.h> |
includes | #include <media/videobuf2-dma-contig.h> |
includes | #include <media/videobuf2-vmalloc.h> |
defines | #define CREATE_TRACE_POINTS |
defines |
#define CODA_PARA_BUF_SIZE (10 * 1024) |
defines | #define CODA7_PS_BUF_SIZE 0x28000 |
defines | #define CODA9_PS_SAVE_SIZE (512 * 1024) |
defines |
#define CODA_DEFAULT_GAMMA 4096 |
defines | #define CODA9_DEFAULT_GAMMA 24576 /* 0.75 * 32768 */ |
functions | int coda_is_initialized(struct coda_dev *dev)
{
return coda_read(dev, CODA_REG_BIT_CUR_PC) != 0;
} |
functions | long coda_isbusy(struct coda_dev *dev)
{
return coda_read(dev, CODA_REG_BIT_BUSY);
} |
functions | int coda_wait_timeout(struct coda_dev *dev)
{
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
while (coda_isbusy(dev)) {
if (time_after(jiffies, timeout))
return -ETIMEDOUT;
} |
functions | void coda_command_async(struct coda_ctx *ctx, int cmd)
{
struct coda_dev *dev = ctx->dev;
if (dev->devtype->product == CODA_960 ||
dev->devtype->product == CODA_7541) {
/* Restore context related registers to CODA */
coda_write(dev, ctx->bit_stream_param,
CODA_REG_BIT_BIT_STREAM_PARAM);
coda_write(dev... |
functions | int coda_command_sync(struct coda_ctx *ctx, int cmd)
{
struct coda_dev *dev = ctx->dev;
int ret;
coda_command_async(ctx, cmd);
ret = coda_wait_timeout(dev);
trace_coda_bit_done(ctx);
return ret;
} |
functions | int coda_hw_reset(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
unsigned long timeout;
unsigned int idx;
int ret;
if (!dev->rstc)
return -ENOENT;
idx = coda_read(dev, CODA_REG_BIT_RUN_INDEX);
if (dev->devtype->product == CODA_960) {
timeout = jiffies + msecs_to_jiffies(100);
coda_write(dev, 0... |
functions | void coda_kfifo_sync_from_device(struct coda_ctx *ctx)
{
struct __kfifo *kfifo = &ctx->bitstream_fifo.kfifo;
struct coda_dev *dev = ctx->dev;
u32 rd_ptr;
rd_ptr = coda_read(dev, CODA_REG_BIT_RD_PTR(ctx->reg_idx));
kfifo->out = (kfifo->in & ~kfifo->mask) |
(rd_ptr - ctx->bitstream.paddr);
if (kfifo->out >... |
functions | void coda_kfifo_sync_to_device_full(struct coda_ctx *ctx)
{
struct __kfifo *kfifo = &ctx->bitstream_fifo.kfifo;
struct coda_dev *dev = ctx->dev;
u32 rd_ptr, wr_ptr;
rd_ptr = ctx->bitstream.paddr + (kfifo->out & kfifo->mask);
coda_write(dev, rd_ptr, CODA_REG_BIT_RD_PTR(ctx->reg_idx));
wr_ptr = ctx->bitstream.padd... |
functions | void coda_kfifo_sync_to_device_write(struct coda_ctx *ctx)
{
struct __kfifo *kfifo = &ctx->bitstream_fifo.kfifo;
struct coda_dev *dev = ctx->dev;
u32 wr_ptr;
wr_ptr = ctx->bitstream.paddr + (kfifo->in & kfifo->mask);
coda_write(dev, wr_ptr, CODA_REG_BIT_WR_PTR(ctx->reg_idx));
} |
functions | int coda_bitstream_pad(struct coda_ctx *ctx, u32 size)
{
unsigned char *buf;
u32 n;
if (size < 6)
size = 6;
buf = kmalloc(size, GFP_KERNEL);
if (!buf)
return -ENOMEM;
coda_h264_filler_nal(size, buf);
n = kfifo_in(&ctx->bitstream_fifo, buf, size);
kfree(buf);
return (n < size) ? -ENOSPC : 0;
} |
functions | int coda_bitstream_queue(struct coda_ctx *ctx,
struct vb2_v4l2_buffer *src_buf)
{
u32 src_size = vb2_get_plane_payload(&src_buf->vb2_buf, 0);
u32 n;
n = kfifo_in(&ctx->bitstream_fifo,
vb2_plane_vaddr(&src_buf->vb2_buf, 0), src_size);
if (n < src_size)
return -ENOSPC;
src_buf->sequence = ctx->qsequence++... |
functions | bool coda_bitstream_try_queue(struct coda_ctx *ctx,
struct vb2_v4l2_buffer *src_buf)
{
unsigned long payload = vb2_get_plane_payload(&src_buf->vb2_buf, 0);
int ret;
if (coda_get_bitstream_payload(ctx) + payload + 512 >=
ctx->bitstream.size)
return false;
if (vb2_plane_vaddr(&src_buf->vb2_buf, 0) =... |
functions | void coda_fill_bitstream(struct coda_ctx *ctx, struct list_head *buffer_list)
{
struct vb2_v4l2_buffer *src_buf;
struct coda_buffer_meta *meta;
unsigned long flags;
u32 start;
if (ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG)
return;
while (v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx) > 0) {
/*
* Onl... |
functions | void coda_bit_stream_end_flag(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
ctx->bit_stream_param |= CODA_BIT_STREAM_END_FLAG;
/* If this context is currently running, update the hardware flag */
if ((dev->devtype->product == CODA_960) &&
coda_isbusy(dev) &&
(ctx->idx == coda_read(dev, CODA_R... |
functions | void coda_parabuf_write(struct coda_ctx *ctx, int index, u32 value)
{
struct coda_dev *dev = ctx->dev;
u32 *p = ctx->parabuf.vaddr;
if (dev->devtype->product == CODA_DX6)
p[index] = value;
else
p[index ^ 1] = value;
} |
functions | int coda_alloc_context_buf(struct coda_ctx *ctx,
struct coda_aux_buf *buf, size_t size,
const char *name)
{
return coda_alloc_aux_buf(ctx->dev, buf, size, name, ctx->debugfs_entry);
} |
functions | void coda_free_framebuffers(struct coda_ctx *ctx)
{
int i;
for (i = 0; i < CODA_MAX_FRAMEBUFFERS; i++)
coda_free_aux_buf(ctx->dev, &ctx->internal_frames[i]);
} |
functions | int coda_alloc_framebuffers(struct coda_ctx *ctx,
struct coda_q_data *q_data, u32 fourcc)
{
struct coda_dev *dev = ctx->dev;
int width, height;
int ysize;
int ret;
int i;
if (ctx->codec && (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 ||
ctx->codec->dst_fourcc == V4L2_PIX_FMT_H264)) {
width = round... |
functions | void coda_free_context_buffers(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
coda_free_aux_buf(dev, &ctx->slicebuf);
coda_free_aux_buf(dev, &ctx->psbuf);
if (dev->devtype->product != CODA_DX6)
coda_free_aux_buf(dev, &ctx->workbuf);
coda_free_aux_buf(dev, &ctx->parabuf);
} |
functions | int coda_alloc_context_buffers(struct coda_ctx *ctx,
struct coda_q_data *q_data)
{
struct coda_dev *dev = ctx->dev;
size_t size;
int ret;
if (!ctx->parabuf.vaddr) {
ret = coda_alloc_context_buf(ctx, &ctx->parabuf,
CODA_PARA_BUF_SIZE, "parabuf");
if (ret < 0)
return ret;
} |
functions | int coda_encode_header(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
int header_code, u8 *header, int *size)
{
struct vb2_buffer *vb = &buf->vb2_buf;
struct coda_dev *dev = ctx->dev;
size_t bufsize;
int ret;
int i;
if (dev->devtype->product == CODA_960)
memset(vb2_plane_vaddr(vb, 0), 0, 64);
co... |
functions | phys_addr_t coda_iram_alloc(struct coda_iram_info *iram, size_t size)
{
phys_addr_t ret;
size = round_up(size, 1024);
if (size > iram->remaining)
return 0;
iram->remaining -= size;
ret = iram->next_paddr;
iram->next_paddr += size;
return ret;
} |
functions | void coda_setup_iram(struct coda_ctx *ctx)
{
struct coda_iram_info *iram_info = &ctx->iram_info;
struct coda_dev *dev = ctx->dev;
int w64, w128;
int mb_width;
int dbk_bits;
int bit_bits;
int ip_bits;
memset(iram_info, 0, sizeof(*iram_info));
iram_info->next_paddr = dev->iram.paddr;
iram_info->remaining = dev... |
functions | else if (ctx->inst_type == CODA_INST_DECODER) {
struct coda_q_data *q_data_dst;
q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
mb_width = DIV_ROUND_UP(q_data_dst->width, 16);
w128 = mb_width * 128;
iram_info->buf_dbk_y_use = coda_iram_alloc(iram_info, w128);
iram_info->buf_dbk_c_use = coda_ira... |
functions | bool coda_firmware_supported(u32 vernum)
{
int i;
for (i = 0; i < ARRAY_SIZE(coda_supported_firmwares); i++)
if (vernum == coda_supported_firmwares[i])
return true;
return false;
} |
functions | int coda_check_firmware(struct coda_dev *dev)
{
u16 product, major, minor, release;
u32 data;
int ret;
ret = clk_prepare_enable(dev->clk_per);
if (ret)
goto err_clk_per;
ret = clk_prepare_enable(dev->clk_ahb);
if (ret)
goto err_clk_ahb;
coda_write(dev, 0, CODA_CMD_FIRMWARE_VERNUM);
coda_write(dev, CODA_... |
functions | void coda9_set_frame_cache(struct coda_ctx *ctx, u32 fourcc)
{
u32 cache_size, cache_config;
if (ctx->tiled_map_type == GDI_LINEAR_FRAME_MAP) {
/* Luma 2x0 page, 2x6 cache, chroma 2x0 page, 2x4 cache size */
cache_size = 0x20262024;
cache_config = 2 << CODA9_CACHE_PAGEMERGE_OFFSET;
} |
functions | int coda_encoder_reqbufs(struct coda_ctx *ctx,
struct v4l2_requestbuffers *rb)
{
struct coda_q_data *q_data_src;
int ret;
if (rb->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
return 0;
if (rb->count) {
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
ret = coda_alloc_context_buffers(ctx, q_data_src);
... |
functions | int coda_start_encoding(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
struct v4l2_device *v4l2_dev = &dev->v4l2_dev;
struct coda_q_data *q_data_src, *q_data_dst;
u32 bitstream_buf, bitstream_size;
struct vb2_v4l2_buffer *buf;
int gamma, ret, value;
u32 dst_fourcc;
int num_fb;
u32 stride;
q_data_sr... |
functions | int coda_prepare_encode(struct coda_ctx *ctx)
{
struct coda_q_data *q_data_src, *q_data_dst;
struct vb2_v4l2_buffer *src_buf, *dst_buf;
struct coda_dev *dev = ctx->dev;
int force_ipicture;
int quant_param = 0;
u32 pic_stream_buffer_addr, pic_stream_buffer_size;
u32 rot_mode = 0;
u32 dst_fourcc;
u32 reg;
src_... |
functions | void coda_finish_encode(struct coda_ctx *ctx)
{
struct vb2_v4l2_buffer *src_buf, *dst_buf;
struct coda_dev *dev = ctx->dev;
u32 wr_ptr, start_ptr;
src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
trace_coda_enc_pic_done(ctx, dst_buf);
/* Get results from th... |
functions | void coda_seq_end_work(struct work_struct *work)
{
struct coda_ctx *ctx = container_of(work, struct coda_ctx, seq_end_work);
struct coda_dev *dev = ctx->dev;
mutex_lock(&ctx->buffer_mutex);
mutex_lock(&dev->coda_mutex);
if (ctx->initialized == 0)
goto out;
v4l2_dbg(1, coda_debug, &dev->v4l2_dev,
"%d: %s: ... |
functions | void coda_bit_release(struct coda_ctx *ctx)
{
mutex_lock(&ctx->buffer_mutex);
coda_free_framebuffers(ctx);
coda_free_context_buffers(ctx);
coda_free_bitstream_buffer(ctx);
mutex_unlock(&ctx->buffer_mutex);
} |
functions | int coda_alloc_bitstream_buffer(struct coda_ctx *ctx,
struct coda_q_data *q_data)
{
if (ctx->bitstream.vaddr)
return 0;
ctx->bitstream.size = roundup_pow_of_two(q_data->sizeimage * 2);
ctx->bitstream.vaddr = dma_alloc_wc(&ctx->dev->plat_dev->dev,
ctx->bitstream.size,
&ctx->bitstream.p... |
functions | void coda_free_bitstream_buffer(struct coda_ctx *ctx)
{
if (ctx->bitstream.vaddr == NULL)
return;
dma_free_wc(&ctx->dev->plat_dev->dev, ctx->bitstream.size,
ctx->bitstream.vaddr, ctx->bitstream.paddr);
ctx->bitstream.vaddr = NULL;
kfifo_init(&ctx->bitstream_fifo, NULL, 0);
} |
functions | int coda_decoder_reqbufs(struct coda_ctx *ctx,
struct v4l2_requestbuffers *rb)
{
struct coda_q_data *q_data_src;
int ret;
if (rb->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
return 0;
if (rb->count) {
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
ret = coda_alloc_context_buffers(ctx, q_data_src);
... |
functions | bool coda_reorder_enable(struct coda_ctx *ctx)
{
const char * const *profile_names;
const char * const *level_names;
struct coda_dev *dev = ctx->dev;
int profile, level;
if (dev->devtype->product != CODA_7541 &&
dev->devtype->product != CODA_960)
return false;
if (ctx->codec->src_fourcc == V4L2_PIX_FMT_J... |
functions | int __coda_start_decoding(struct coda_ctx *ctx)
{
struct coda_q_data *q_data_src, *q_data_dst;
u32 bitstream_buf, bitstream_size;
struct coda_dev *dev = ctx->dev;
int width, height;
u32 src_fourcc, dst_fourcc;
u32 val;
int ret;
v4l2_dbg(1, coda_debug, &dev->v4l2_dev,
"Video Data Order Adapter: %s\n",
ctx... |
functions | else if (dev->devtype->product == CODA_960) {
int max_mb_x = 1920 / 16;
int max_mb_y = 1088 / 16;
int max_mb_num = max_mb_x * max_mb_y;
coda_write(dev, max_mb_num << 16 | max_mb_x << 8 | max_mb_y,
CODA9_CMD_SET_FRAME_MAX_DEC_SIZE);
} |
functions | int coda_start_decoding(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
int ret;
mutex_lock(&dev->coda_mutex);
ret = __coda_start_decoding(ctx);
mutex_unlock(&dev->coda_mutex);
return ret;
} |
functions | int coda_prepare_decode(struct coda_ctx *ctx)
{
struct vb2_v4l2_buffer *dst_buf;
struct coda_dev *dev = ctx->dev;
struct coda_q_data *q_data_dst;
struct coda_buffer_meta *meta;
unsigned long flags;
u32 rot_mode = 0;
u32 reg_addr, reg_stride;
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
q_data_dst = get_q... |
functions | void coda_finish_decode(struct coda_ctx *ctx)
{
struct coda_dev *dev = ctx->dev;
struct coda_q_data *q_data_src;
struct coda_q_data *q_data_dst;
struct vb2_v4l2_buffer *dst_buf;
struct coda_buffer_meta *meta;
unsigned long payload;
unsigned long flags;
int width, height;
int decoded_idx;
int display_idx;
u32... |
functions | else if (decoded_idx == -2) {
/* no frame was decoded, we still return remaining buffers */
} |
functions | else if (decoded_idx < 0 || decoded_idx >= ctx->num_internal_frames) {
v4l2_err(&dev->v4l2_dev,
"decoded frame index out of range: %d\n", decoded_idx);
} |
functions | else if (display_idx == -3) {
/* possibly prescan failure */
} |
functions | else if (display_idx < 0 || display_idx >= ctx->num_internal_frames) {
v4l2_err(&dev->v4l2_dev,
"presentation frame index out of range: %d\n",
display_idx);
} |
functions | void coda_error_decode(struct coda_ctx *ctx)
{
struct vb2_v4l2_buffer *dst_buf;
/*
* For now this only handles the case where we would deadlock with
* userspace, i.e. userspace issued DEC_CMD_STOP and waits for EOS,
* but after a failed decode run we would hold the context and wait for
* userspace to queue m... |
functions | irqreturn_t coda_irq_handler(int irq, void *data)
{
struct coda_dev *dev = data;
struct coda_ctx *ctx;
/* read status register to attend the IRQ */
coda_read(dev, CODA_REG_BIT_INT_STATUS);
coda_write(dev, CODA_REG_BIT_INT_CLEAR_SET,
CODA_REG_BIT_INT_CLEAR);
ctx = v4l2_m2m_get_curr_priv(dev->m2m_dev);
i... |
defines | #define JEMALLOC_STATS_C_ |
defines |
#define CTL_GET(n, v, t) do { \ |
defines |
#define CTL_I_GET(n, v, t) do { \ |
defines |
#define CTL_J_GET(n, v, t) do { \ |
defines |
#define CTL_IJ_GET(n, v, t) do { \ |
functions | void
malloc_printf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
malloc_vcprintf(NULL, NULL, format, ap);
va_end(ap);
} |
includes |
#include <stdbool.h> |
includes | #include <stdint.h> |
functions | bool extF80M_lt_quiet( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
{
return extF80_lt_quiet( *aPtr, *bPtr );
} |
functions | bool extF80M_lt_quiet( const extFloat80_t *aPtr, const extFloat80_t *bPtr )
{
const struct extFloat80M *aSPtr, *bSPtr;
uint_fast16_t uiA64;
uint64_t uiA0;
uint_fast16_t uiB64;
uint64_t uiB0;
bool signA, ltMags;
/*---------------------------------------------------------------------... |
includes |
#include <console/console.h> |
includes | #include <device/device.h> |
includes | #include <device/pci.h> |
includes | #include <arch/io.h> |
includes | #include <cpu/x86/msr.h> |
includes | #include <cpu/amd/mtrr.h> |
includes | #include <device/pci_def.h> |
functions | void set_pcie_dereset()
{
u16 word;
device_t sm_dev;
/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
word = pci_read_config16(sm_dev, 0xA8);
word |= (1 << 0) | (1 << 2); /* Set Gpio6,4 as output */
word &= ~((1 << 8) | (1 << 10));
pci_write_config16(sm_dev, 0x... |
functions | void set_pcie_reset()
{
u16 word;
device_t sm_dev;
/* GPIO 6 reset PCIe slot, GPIO 4 reset GFX PCIe */
sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
word = pci_read_config16(sm_dev, 0xA8);
word &= ~((1 << 0) | (1 << 2)); /* Set Gpio6,4 as output */
word &= ~((1 << 8) | (1 << 10));
pci_write_config16(sm_dev, 0... |
functions | void get_ide_dma66(void)
{
u8 byte;
/*u32 sm_dev, ide_dev; */
device_t sm_dev, ide_dev;
sm_dev = dev_find_slot(0, PCI_DEVFN(0x14, 0));
byte = pci_read_config8(sm_dev, 0xA9);
byte |= (1 << 5); /* Set Gpio9 as input */
pci_write_config8(sm_dev, 0xA9, byte);
ide_dev = dev_find_slot(0, PCI_DEVFN(0x14, 1));
byte... |
functions | u8 is_dev3_present(void)
{
return 0;
} |
functions | void mainboard_enable(device_t dev)
{
printk(BIOS_INFO, "Mainboard MAHOGANY Enable. dev=0x%p\n", dev);
set_pcie_dereset();
/* get_ide_dma66(); */
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.