From patchwork Mon Aug 19 15:59:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2846611 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA4CCBF546 for ; Mon, 19 Aug 2013 16:22:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59CE5203AC for ; Mon, 19 Aug 2013 16:22:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1056A2039B for ; Mon, 19 Aug 2013 16:22:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E51CEE6905 for ; Mon, 19 Aug 2013 09:22:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id D2CF2E723E; Mon, 19 Aug 2013 08:59:28 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 19 Aug 2013 08:59:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,914,1367996400"; d="scan'208";a="348429006" Received: from unknown (HELO strange.amr.corp.intel.com) ([10.255.14.123]) by azsmga001.ch.intel.com with ESMTP; 19 Aug 2013 08:59:27 -0700 From: Damien Lespiau To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/14] video/hdmi: Use hdmi_vendor_infoframe for the HDMI specific infoframe Date: Mon, 19 Aug 2013 16:59:02 +0100 Message-Id: <1376927945-26635-12-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1376927945-26635-1-git-send-email-damien.lespiau@intel.com> References: <1376927945-26635-1-git-send-email-damien.lespiau@intel.com> Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We just got rid of the version of hdmi_vendor_infoframe that had a byte array for anyone to poke at. It's now time to shuffle around the naming of hdmi_hdmi_infoframe to make hdmi_vendor_infoframe become the HDMI vendor specific structure. Cc: Thierry Reding Signed-off-by: Damien Lespiau --- drivers/gpu/host1x/drm/hdmi.c | 6 +++--- drivers/video/hdmi.c | 25 +++++++++++++------------ include/linux/hdmi.h | 15 ++++++++------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c index b548918..52e3c96 100644 --- a/drivers/gpu/host1x/drm/hdmi.c +++ b/drivers/gpu/host1x/drm/hdmi.c @@ -539,7 +539,7 @@ static void tegra_hdmi_setup_audio_infoframe(struct tegra_hdmi *hdmi) static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi) { - struct hdmi_hdmi_infoframe frame; + struct hdmi_vendor_infoframe frame; unsigned long value; u8 buffer[10]; ssize_t err; @@ -551,10 +551,10 @@ static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi) return; } - hdmi_hdmi_infoframe_init(&frame); + hdmi_vendor_infoframe_init(&frame); frame.s3d_struct = HDMI_3D_STRUCTURE_FRAME_PACKING; - err = hdmi_hdmi_infoframe_pack(&frame, buffer, sizeof(buffer)); + err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer)); if (err < 0) { dev_err(hdmi->dev, "failed to pack vendor infoframe: %zd\n", err); diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c index fbccb88..4f73167 100644 --- a/drivers/video/hdmi.c +++ b/drivers/video/hdmi.c @@ -288,12 +288,12 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, EXPORT_SYMBOL(hdmi_audio_infoframe_pack); /** - * hdmi_hdmi_infoframe_init() - initialize an HDMI vendor infoframe + * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe * @frame: HDMI vendor infoframe * * Returns 0 on success or a negative error code on failure. */ -int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame) +int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame) { memset(frame, 0, sizeof(*frame)); @@ -310,10 +310,10 @@ int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame) return 0; } -EXPORT_SYMBOL(hdmi_hdmi_infoframe_init); +EXPORT_SYMBOL(hdmi_vendor_infoframe_init); /** - * hdmi_hdmi_infoframe_pack() - write a HDMI vendor infoframe to binary buffer + * hdmi_vendor_infoframe_pack() - write a HDMI vendor infoframe to binary buffer * @frame: HDMI infoframe * @buffer: destination buffer * @size: size of buffer @@ -326,7 +326,7 @@ EXPORT_SYMBOL(hdmi_hdmi_infoframe_init); * Returns the number of bytes packed into the binary buffer or a negative * error code on failure. */ -ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame, +ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, void *buffer, size_t size) { u8 *ptr = buffer; @@ -377,19 +377,20 @@ ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame, return length; } -EXPORT_SYMBOL(hdmi_hdmi_infoframe_pack); +EXPORT_SYMBOL(hdmi_vendor_infoframe_pack); /* - * hdmi_vendor_infoframe_pack() - write a vendor infoframe to binary buffer + * hdmi_vendor_any_infoframe_pack() - write a vendor infoframe to binary buffer */ -static ssize_t hdmi_vendor_infoframe_pack(union hdmi_vendor_infoframe *frame, - void *buffer, size_t size) +static ssize_t +hdmi_vendor_any_infoframe_pack(union hdmi_vendor_any_infoframe *frame, + void *buffer, size_t size) { /* we only know about HDMI vendor infoframes */ if (frame->any.oui != HDMI_IDENTIFIER) return -EINVAL; - return hdmi_hdmi_infoframe_pack(&frame->hdmi, buffer, size); + return hdmi_vendor_infoframe_pack(&frame->hdmi, buffer, size); } /** @@ -422,8 +423,8 @@ hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size) length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size); break; case HDMI_INFOFRAME_TYPE_VENDOR: - length = hdmi_vendor_infoframe_pack(&frame->vendor, - buffer, size); + length = hdmi_vendor_any_infoframe_pack(&frame->vendor, + buffer, size); break; default: WARN(1, "Bad infoframe type %d\n", frame->any.type); diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h index e24d850..d4ae12c 100644 --- a/include/linux/hdmi.h +++ b/include/linux/hdmi.h @@ -237,7 +237,8 @@ enum hdmi_3d_structure { HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8, }; -struct hdmi_hdmi_infoframe { + +struct hdmi_vendor_infoframe { enum hdmi_infoframe_type type; unsigned char version; unsigned char length; @@ -247,25 +248,25 @@ struct hdmi_hdmi_infoframe { unsigned int s3d_ext_data; }; -int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame); -ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame, - void *buffer, size_t size); +int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame); +ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, + void *buffer, size_t size); -union hdmi_vendor_infoframe { +union hdmi_vendor_any_infoframe { struct { enum hdmi_infoframe_type type; unsigned char version; unsigned char length; unsigned int oui; } any; - struct hdmi_hdmi_infoframe hdmi; + struct hdmi_vendor_infoframe hdmi; }; union hdmi_infoframe { struct hdmi_any_infoframe any; struct hdmi_avi_infoframe avi; struct hdmi_spd_infoframe spd; - union hdmi_vendor_infoframe vendor; + union hdmi_vendor_any_infoframe vendor; struct hdmi_audio_infoframe audio; };