コード例 #1
0
ファイル: ps3av.c プロジェクト: acassis/emlinux-ssd1935
static void ps3av_set_videomode_packet(u32 id)
{
    struct ps3av_pkt_avb_param avb_param;
    unsigned int i;
    u32 len = 0, av_video_cs;
    const struct avset_video_mode *video_mode;
    int res;

    video_mode = &video_mode_table[id & PS3AV_MODE_MASK];

    avb_param.num_of_video_pkt = PS3AV_AVB_NUM_VIDEO;	/* num of head */
    avb_param.num_of_audio_pkt = 0;
    avb_param.num_of_av_video_pkt = ps3av->av_hw_conf.num_of_hdmi +
                                    ps3av->av_hw_conf.num_of_avmulti;
    avb_param.num_of_av_audio_pkt = 0;

    /* video_pkt */
    for (i = 0; i < avb_param.num_of_video_pkt; i++)
        len += ps3av_cmd_set_video_mode(&avb_param.buf[len],
                                        ps3av->head[i], video_mode->vid,
                                        video_mode->fmt, id);
    /* av_video_pkt */
    for (i = 0; i < avb_param.num_of_av_video_pkt; i++) {
        if (id & PS3AV_MODE_DVI || id & PS3AV_MODE_RGB)
            av_video_cs = RGB8;
        else
            av_video_cs = video_mode->cs;
#ifndef PS3AV_HDMI_YUV
        if (ps3av->av_port[i] == PS3AV_CMD_AVPORT_HDMI_0 ||
                ps3av->av_port[i] == PS3AV_CMD_AVPORT_HDMI_1)
            av_video_cs = RGB8;	/* use RGB for HDMI */
#endif
        len += ps3av_cmd_set_av_video_cs(&avb_param.buf[len],
                                         ps3av->av_port[i],
                                         video_mode->vid, av_video_cs,
                                         video_mode->aspect, id);
    }
    /* send command using avb pkt */
    len += offsetof(struct ps3av_pkt_avb_param, buf);
    res = ps3av_cmd_avb_param(&avb_param, len);
    if (res == PS3AV_STATUS_NO_SYNC_HEAD)
        printk(KERN_WARNING
               "%s: Command failed. Please try your request again. \n",
               __func__);
    else if (res)
        dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n");
}
コード例 #2
0
ファイル: ps3av.c プロジェクト: cilynx/dd-wrt
static void ps3av_set_videomode_cont(u32 id, u32 old_id)
{
	struct ps3av_pkt_avb_param avb_param;
	int i;
	u32 len = 0, av_video_cs;
	const struct avset_video_mode *video_mode;
	int res;

	video_mode = &video_mode_table[id & PS3AV_MODE_MASK];

	avb_param.num_of_video_pkt = PS3AV_AVB_NUM_VIDEO;	/* num of head */
	avb_param.num_of_audio_pkt = 0;
	avb_param.num_of_av_video_pkt = ps3av->av_hw_conf.num_of_hdmi +
					ps3av->av_hw_conf.num_of_avmulti;
	avb_param.num_of_av_audio_pkt = 0;

	/* video signal off */
	ps3av_set_video_disable_sig();

	/* Retail PS3 product doesn't support this */
	if (id & PS3AV_MODE_HDCP_OFF) {
		res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_HDCP_OFF);
		if (res == PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
			dev_dbg(&ps3av->dev->core, "Not supported\n");
		else if (res)
			dev_dbg(&ps3av->dev->core,
				"ps3av_cmd_av_hdmi_mode failed\n");
	} else if (old_id & PS3AV_MODE_HDCP_OFF) {
		res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_MODE_NORMAL);
		if (res < 0 && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
			dev_dbg(&ps3av->dev->core,
				"ps3av_cmd_av_hdmi_mode failed\n");
	}

	/* video_pkt */
	for (i = 0; i < avb_param.num_of_video_pkt; i++)
		len += ps3av_cmd_set_video_mode(&avb_param.buf[len],
						ps3av->head[i], video_mode->vid,
						video_mode->fmt, id);
	/* av_video_pkt */
	for (i = 0; i < avb_param.num_of_av_video_pkt; i++) {
		if (id & PS3AV_MODE_DVI || id & PS3AV_MODE_RGB)
			av_video_cs = RGB8;
		else
			av_video_cs = video_mode->cs;
#ifndef PS3AV_HDMI_YUV
		if (ps3av->av_port[i] == PS3AV_CMD_AVPORT_HDMI_0 ||
		    ps3av->av_port[i] == PS3AV_CMD_AVPORT_HDMI_1)
			av_video_cs = RGB8;	/* use RGB for HDMI */
#endif
		len += ps3av_cmd_set_av_video_cs(&avb_param.buf[len],
						 ps3av->av_port[i],
						 video_mode->vid, av_video_cs,
						 video_mode->aspect, id);
	}
	/* send command using avb pkt */
	len += offsetof(struct ps3av_pkt_avb_param, buf);
	res = ps3av_cmd_avb_param(&avb_param, len);
	if (res == PS3AV_STATUS_NO_SYNC_HEAD)
		printk(KERN_WARNING
		       "%s: Command failed. Please try your request again. \n",
		       __func__);
	else if (res)
		dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n");

	msleep(1500);
	/* av video mute */
	ps3av_set_av_video_mute(PS3AV_CMD_MUTE_OFF);
}