From patchwork Tue Sep 18 10:53:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1528061 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork1.kernel.org (Postfix) with ESMTP id C95883FE80 for ; Sat, 29 Sep 2012 06:53:06 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8T6pYvQ020957; Sat, 29 Sep 2012 01:51:34 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8T6pYlP011170; Sat, 29 Sep 2012 01:51:34 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Sat, 29 Sep 2012 01:51:34 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8T6pYpS010456; Sat, 29 Sep 2012 01:51:34 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 08B0B8062B; Sat, 29 Sep 2012 01:51:34 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id B3E0D80626 for ; Tue, 18 Sep 2012 05:53:31 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8IArVN7019178 for ; Tue, 18 Sep 2012 05:53:31 -0500 (CDT) Received: from psmtp.com (na3sys009amx235.postini.com [74.125.149.119]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id q8IArUqh016808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 18 Sep 2012 05:53:30 -0500 Received: from ams-iport-2.cisco.com ([144.254.224.141]) (using TLSv1) by na3sys009amx235.postini.com ([74.125.148.10]) with SMTP; Tue, 18 Sep 2012 10:53:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3782; q=dns/txt; s=iport; t=1347965610; x=1349175210; h=from:to:cc:subject:date:message-id; bh=96vQAh9ToaRpxizvfVaZqC7wq2aijWQDS54m8FD8dnY=; b=faTn1w6rtXErm0d6IpV6D1M91NEzW3MvEfb7v0+HWy95E7AuabIW02q0 R9jQJz6zu87sasYgvTlocUjUa88qdErRJ7MhlnB2EF+Sp7KQQrQNKMbfN ZYzWIx4jZwY62fSH9traX7vflb86Kc2U1SyC+CcHNt+PbrgWjdrlBLE0z k=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAE9RWFCQ/khR/2dsb2JhbABFvDOBB4IhAQEEEgEUUhBRVxkih16aI6A1kgkDlWKJNYUDgWmCaA X-IronPort-AV: E=Sophos;i="4.80,442,1344211200"; d="scan'208";a="76781998" Received: from ams-core-1.cisco.com ([144.254.72.81]) by ams-iport-2.cisco.com with ESMTP; 18 Sep 2012 10:53:27 +0000 Received: from cobaltpc1.cisco.com (dhcp-10-54-92-107.cisco.com [10.54.92.107]) by ams-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id q8IArQ4S012350; Tue, 18 Sep 2012 10:53:27 GMT From: Hans Verkuil To: Subject: [RFCv1 PATCH 04/11] vpif_display: move output_id to channel_obj. Date: Tue, 18 Sep 2012 12:53:06 +0200 Message-ID: <4b1a596ad93a1963d6a98b56508d815b5324c0a5.1347965140.git.hans.verkuil@cisco.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0003) s cv gt3 GT2 gt1 r p m c X-pstn-addresses: from [82/3] X-Mailman-Approved-At: Sat, 29 Sep 2012 01:48:44 -0500 CC: DLOS X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com The output index does not belong to video_obj, it belongs to channel_obj. Also rename to output_idx to be consistent with the input_idx name used in vpif_capture. Signed-off-by: Hans Verkuil --- drivers/media/video/davinci/vpif_display.c | 17 ++++++----------- drivers/media/video/davinci/vpif_display.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 371a459..19338b4 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -1217,7 +1217,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; int ret = 0; @@ -1232,7 +1231,7 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) if (ret < 0) vpif_err("Failed to set output standard\n"); - vid_ch->output_id = i; + ch->output_idx = i; return ret; } @@ -1240,9 +1239,8 @@ static int vpif_g_output(struct file *file, void *priv, unsigned int *i) { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - *i = vid_ch->output_id; + *i = ch->output_idx; return 0; } @@ -1276,9 +1274,8 @@ static int vpif_enum_dv_timings(struct file *file, void *priv, { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], video, enum_dv_timings, timings); } @@ -1305,7 +1302,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, } /* Configure subdevice timings, if any */ - ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], + ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx], video, s_dv_timings, timings); if (ret == -ENOIOCTLCMD) { vpif_dbg(2, debug, "Custom DV timings not supported by " @@ -1436,9 +1433,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg){ struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, g_register, reg); } @@ -1455,9 +1451,8 @@ static int vpif_dbg_s_register(struct file *file, void *priv, struct v4l2_dbg_register *reg){ struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, s_register, reg); } #endif diff --git a/drivers/media/video/davinci/vpif_display.h b/drivers/media/video/davinci/vpif_display.h index ad22c70..b602def 100644 --- a/drivers/media/video/davinci/vpif_display.h +++ b/drivers/media/video/davinci/vpif_display.h @@ -63,7 +63,6 @@ struct video_obj { v4l2_std_id stdid; /* Currently selected or default * standard */ struct v4l2_dv_timings dv_timings; - u32 output_id; /* Current output id */ }; struct vpif_disp_buffer { @@ -126,6 +125,7 @@ struct channel_obj { * which is being displayed */ u8 initialized; /* flag to indicate whether * encoder is initialized */ + u32 output_idx; /* Current output index */ enum vpif_channel_id channel_id;/* Identifies channel */ struct vpif_params vpifparams;