Beispiel #1
0
static int _hw_configure(struct nxp_decimator *me)
{
    struct nxp_capture *parent = nxp_decimator_to_parent(me);
    int module = parent->get_module_num(parent);

    vmsg("decimator %s: source(%dx%d), target(%dx%d)\n", __func__,
            me->src_width, me->src_height,
            me->target_width, me->target_height);

#if 0
    NX_VIP_SetClipRegion(module, 0, 0, me->src_width, me->src_height);

    NX_VIP_SetDecimation(module,
            me->src_width, me->src_height,
            me->target_width, me->target_height);

    NX_VIP_SetDecimatorFormat(module,
            _convert_to_vip_format(me->code) , false, false, false);
#else
    // check clipper on & clipper region
    {
    #if defined(CONFIG_ARCH_S5P4418)
        int left, top, right, bottom;
        NX_VIP_GetClipRegion(module, &left, &top, &right, &bottom);
        if ((me->src_width != (right - left)) || (me->src_height != (bottom - top))) {
            pr_err("%s: current clipper setting is differ from me\n", __func__);
            pr_err("clipper(%d,%d--%d,%d)\n", left, top, right, bottom);
            pr_err("me(%d,%d--%d,%d)\n", 0, 0, me->src_width, me->src_height);
            pr_err("setting force me to clipper: %d,%d --> %d,%d\n", right, bottom, YUV_YSTRIDE(right-127), bottom);

            NX_VIP_SetClipRegion(module, 0, 0, right, bottom);
            NX_VIP_SetDecimation(module,
                    right, bottom,
                    YUV_YSTRIDE(right - 127), bottom);

        } else {
            NX_VIP_SetClipRegion(module, 0, 0, me->src_width, me->src_height);
            NX_VIP_SetDecimation(module,
                    me->src_width, me->src_height,
                    me->target_width, me->target_height);
        }
    #else
        NX_VIP_SetClipRegion(module, 0, 0, me->src_width, me->src_height);
        NX_VIP_SetDecimation(module,
                me->src_width, me->src_height,
                me->target_width, me->target_height);
    #endif

    #if defined(CONFIG_ARCH_S5P4418)
        NX_VIP_SetDecimatorFormat(module,
                _convert_to_vip_format(me->code) , false, false, false);
    #elif defined(CONFIG_ARCH_S5P6818)
        NX_VIP_SetDecimatorFormat(module, _convert_to_vip_format(me->code));
    #endif
    }
#endif

    return 0;
}
static int _hw_configure(struct nxp_decimator *me)
{
    struct nxp_capture *parent = nxp_decimator_to_parent(me);
    int module = parent->get_module_num(parent);

    printk("decimator %s: source(%dx%d), target(%dx%d)\n", __func__,
            me->src_width, me->src_height,
            me->target_width, me->target_height);

    NX_VIP_SetClipRegion(module, 0, 0, me->src_width, me->src_height);

    NX_VIP_SetDecimation(module,
            me->src_width, me->src_height,
            me->target_width, me->target_height);

    NX_VIP_SetDecimatorFormat(module,
            _convert_to_vip_format(me->code) , false, false, false);

    return 0;
}
static int _hw_set_addr(struct nxp_decimator *me, struct nxp_video_buffer *buf)
{
    struct nxp_capture *parent = nxp_decimator_to_parent(me);
    int module = parent->get_module_num(parent);

    if (me->code == V4L2_MBUS_FMT_YUYV8_2X8) {
        // YUYV422
        /* printk("%s decimator: addr 0x%x\n", __func__, buf->dma_addr[0]); */
        NX_VIP_SetDecimatorAddr(module,
                NX_VIP_FORMAT_YUYV,
                me->target_width,
                me->target_height,
                buf->dma_addr[0],
                0,
#ifdef CONFIG_ARCH_NXP4330_3200
                0);
#else
                0,
                buf->stride[0], 0);
#endif
    } else {