From patchwork Tue Feb 4 03:19:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24080 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B8F2120445 for ; Tue, 4 Feb 2014 03:19:28 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id m10sf20280966vbh.8 for ; Mon, 03 Feb 2014 19:19:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=H8ZKEbSAot7tv6XCuhh/6dOVJI0Cldb1yZtVjN0SItc=; b=CASztA8KsJ5MZWq653HWX8ibnzi2hT2xfkrldEAEzq8kW5dtDmcN5FrgzfYgnGZWv2 z4MyrXX/VgECbUuTfuWCqFOoXVfGEHmi60H0s1ilSwKRBQgZthipCly9lKXndMRbLbKO u1YYFhfLtAVh2mLHs3UUJ4G3ePDHLViCRHhyhOsGFz9W2wVyyBKXIH2PZ9Cc/uCw/C51 Dyxvwi+8GtGNxnXr/mz+ZTgLDJwKNKXL1EHdaHTB/u1d7vD/W4kbDl9QwmLRf+KolpeD 6g0bVHEPAk8WkifZasspwuZ7jFPTw26IHU7i6SuNx/UtGof6vbKTH80FCpPsPfaEKwgF RJcQ== X-Gm-Message-State: ALoCoQkp7cWAu5CBAkR5IYImVsnwlsBZWdPAuQJVEamMa8smC7HeJbMvb/6KiBpFQpTLvNyJnKkf X-Received: by 10.236.121.4 with SMTP id q4mr13959136yhh.34.1391483967422; Mon, 03 Feb 2014 19:19:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.240 with SMTP id b103ls2110609qge.57.gmail; Mon, 03 Feb 2014 19:19:27 -0800 (PST) X-Received: by 10.220.58.202 with SMTP id i10mr4257511vch.23.1391483967347; Mon, 03 Feb 2014 19:19:27 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id uo16si7547583veb.10.2014.02.03.19.19.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 19:19:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id le5so5513054vcb.30 for ; Mon, 03 Feb 2014 19:19:27 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr33884vcu.34.1391483967249; Mon, 03 Feb 2014 19:19:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp202732vcz; Mon, 3 Feb 2014 19:19:26 -0800 (PST) X-Received: by 10.60.84.199 with SMTP id b7mr51375oez.55.1391483966071; Mon, 03 Feb 2014 19:19:26 -0800 (PST) Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by mx.google.com with ESMTPS id ti9si10829965obc.153.2014.02.03.19.19.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Feb 2014 19:19:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.173 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.214.173; Received: by mail-ob0-f173.google.com with SMTP id vb8so8818980obc.4 for ; Mon, 03 Feb 2014 19:19:25 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.44.8 with SMTP id a8mr13219357oem.19.1391483965749; Mon, 03 Feb 2014 19:19:25 -0800 (PST) Received: by 10.60.73.72 with HTTP; Mon, 3 Feb 2014 19:19:25 -0800 (PST) In-Reply-To: References: <1391148572-24130-1-git-send-email-sachin.kamat@linaro.org> Date: Tue, 4 Feb 2014 08:49:25 +0530 Message-ID: Subject: Re: [PATCH 1/1] drm/exynos: Fix build error in exynos_hdmi.c From: Sachin Kamat To: Sean Paul Cc: Inki Dae , Seung-Woo Kim , DRI mailing list , "patches@linaro.org" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 4 February 2014 05:05, Sean Paul wrote: > On Mon, Feb 3, 2014 at 7:14 AM, Inki Dae wrote: >> 2014-01-31 Josh Boyer : >>> On Fri, Jan 31, 2014 at 1:09 AM, Sachin Kamat wrote: >>>> 'hdmi_infoframe' is already defined in include/linux/hdmi.h. >>>> Rename the local variable to avoid the following build error: >>>> drivers/gpu/drm/exynos/exynos_hdmi.c:382:8: error: 'hdmi_infoframe' defined as wrong kind of tag >>>> struct hdmi_infoframe { >>>> >>>> Signed-off-by: Sachin Kamat >>>> Reported-by: Josh Boyer >>> >>> This does fix the build error I saw. I don't have hardware to test >>> the results with, but it now compiles correctly. Thanks for the quick >>> turn around! >>> >> >> Hi, >> >> Thanks for report and patch. But Sean posted already below patch, >> [PATCH v4 01/34] drm/exynos: Rename hdmi_infoframe to avoid collision >> > > Yeah, sorry, I just tucked it in with the rest of my stuff :) No worries as long as the issue gets addressed :) However, since these patches are not yet merged, IMHO it would be better to address this issue by re-using the common definitions provided rather than having local (duplicate) definitions for the same. Below is the patch which I have also posted to the mailing list for reference. Please check. ------------------------------------------------------------------------ return readl(hdata->regs + reg_id); @@ -682,7 +664,7 @@ static u8 hdmi_chksum(struct hdmi_context *hdata, } static void hdmi_reg_infoframe(struct hdmi_context *hdata, - struct hdmi_infoframe *infoframe) + union hdmi_infoframe *infoframe) { u32 hdr_sum; u8 chksum; @@ -700,13 +682,15 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, return; } - switch (infoframe->type) { - case HDMI_PACKET_TYPE_AVI: + switch (infoframe->any.type) { + case HDMI_INFOFRAME_TYPE_AVI: hdmi_reg_writeb(hdata, HDMI_AVI_CON, HDMI_AVI_CON_EVERY_VSYNC); - hdmi_reg_writeb(hdata, HDMI_AVI_HEADER0, infoframe->type); - hdmi_reg_writeb(hdata, HDMI_AVI_HEADER1, infoframe->ver); - hdmi_reg_writeb(hdata, HDMI_AVI_HEADER2, infoframe->len); - hdr_sum = infoframe->type + infoframe->ver + infoframe->len; + hdmi_reg_writeb(hdata, HDMI_AVI_HEADER0, infoframe->any.type); + hdmi_reg_writeb(hdata, HDMI_AVI_HEADER1, + infoframe->any.version); + hdmi_reg_writeb(hdata, HDMI_AVI_HEADER2, infoframe->any.length); + hdr_sum = infoframe->any.type + infoframe->any.version + + infoframe->any.length; /* Output format zero hardcoded ,RGB YBCR selection */ hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(1), 0 << 5 | @@ -722,18 +706,20 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(4), vic); chksum = hdmi_chksum(hdata, HDMI_AVI_BYTE(1), - infoframe->len, hdr_sum); + infoframe->any.length, hdr_sum); DRM_DEBUG_KMS("AVI checksum = 0x%x\n", chksum); hdmi_reg_writeb(hdata, HDMI_AVI_CHECK_SUM, chksum); break; - case HDMI_PACKET_TYPE_AUI: + case HDMI_INFOFRAME_TYPE_AUDIO: hdmi_reg_writeb(hdata, HDMI_AUI_CON, 0x02); - hdmi_reg_writeb(hdata, HDMI_AUI_HEADER0, infoframe->type); - hdmi_reg_writeb(hdata, HDMI_AUI_HEADER1, infoframe->ver); - hdmi_reg_writeb(hdata, HDMI_AUI_HEADER2, infoframe->len); - hdr_sum = infoframe->type + infoframe->ver + infoframe->len; + hdmi_reg_writeb(hdata, HDMI_AUI_HEADER0, infoframe->any.type); + hdmi_reg_writeb(hdata, HDMI_AUI_HEADER1, + infoframe->any.version); + hdmi_reg_writeb(hdata, HDMI_AUI_HEADER2, infoframe->any.length); + hdr_sum = infoframe->any.type + infoframe->any.version + + infoframe->any.length; chksum = hdmi_chksum(hdata, HDMI_AUI_BYTE(1), - infoframe->len, hdr_sum); + infoframe->any.length, hdr_sum); DRM_DEBUG_KMS("AUI checksum = 0x%x\n", chksum); hdmi_reg_writeb(hdata, HDMI_AUI_CHECK_SUM, chksum); break; @@ -985,7 +971,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata) static void hdmi_conf_init(struct hdmi_context *hdata) { - struct hdmi_infoframe infoframe; + union hdmi_infoframe infoframe; /* disable HPD interrupts from HDMI IP block, use GPIO instead */ hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL | @@ -1021,14 +1007,14 @@ static void hdmi_conf_init(struct hdmi_context *hdata) hdmi_reg_writeb(hdata, HDMI_V13_AUI_CON, 0x02); hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 0x04); } else { - infoframe.type = HDMI_PACKET_TYPE_AVI; - infoframe.ver = HDMI_AVI_VERSION; - infoframe.len = HDMI_AVI_LENGTH; + infoframe.any.type = HDMI_INFOFRAME_TYPE_AVI; + infoframe.any.version = HDMI_AVI_VERSION; + infoframe.any.length = HDMI_AVI_LENGTH; hdmi_reg_infoframe(hdata, &infoframe); - infoframe.type = HDMI_PACKET_TYPE_AUI; - infoframe.ver = HDMI_AUI_VERSION; - infoframe.len = HDMI_AUI_LENGTH; + infoframe.any.type = HDMI_INFOFRAME_TYPE_AUDIO; + infoframe.any.version = HDMI_AUI_VERSION; + infoframe.any.length = HDMI_AUI_LENGTH; hdmi_reg_infoframe(hdata, &infoframe); /* enable AVI packet every vsync, fixes purple line problem */ diff --git a/drivers/gpu/drm/exynos/ exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index a0e10ae..c021ddc 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -59,19 +60,6 @@ #define HDMI_AUI_VERSION 0x01 #define HDMI_AUI_LENGTH 0x0A -/* HDMI infoframe to configure HDMI out packet header, AUI and AVI */ -enum HDMI_PACKET_TYPE { - /* refer to Table 5-8 Packet Type in HDMI specification v1.4a */ - /* InfoFrame packet type */ - HDMI_PACKET_TYPE_INFOFRAME = 0x80, - /* Vendor-Specific InfoFrame */ - HDMI_PACKET_TYPE_VSI = HDMI_PACKET_TYPE_INFOFRAME + 1, - /* Auxiliary Video information InfoFrame */ - HDMI_PACKET_TYPE_AVI = HDMI_PACKET_TYPE_INFOFRAME + 2, - /* Audio information InfoFrame */ - HDMI_PACKET_TYPE_AUI = HDMI_PACKET_TYPE_INFOFRAME + 4 -}; - enum hdmi_type { HDMI_TYPE13, HDMI_TYPE14, @@ -379,12 +367,6 @@ static const struct hdmiphy_config hdmiphy_v14_configs[] = { }, }; -struct hdmi_infoframe { - enum HDMI_PACKET_TYPE type; - u8 ver; - u8 len; -}; - static inline u32 hdmi_reg_read(struct hdmi_context *hdata, u32 reg_id) {