From patchwork Sun May 4 15:26:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 4107681 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7EA939F271 for ; Sun, 4 May 2014 15:27:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1BD4203F7 for ; Sun, 4 May 2014 15:27:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF0CF203EC for ; Sun, 4 May 2014 15:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbaEDP0r (ORCPT ); Sun, 4 May 2014 11:26:47 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33743 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752334AbaEDP0p (ORCPT ); Sun, 4 May 2014 11:26:45 -0400 Received: by mail-pa0-f45.google.com with SMTP id ey11so2720873pad.4 for ; Sun, 04 May 2014 08:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3OSciSshxw1ajbuKC+nDurngCfD9G/F9+9W2Q6xNVPI=; b=kGFMYC39QPlly6ipd/df+mTE54WrFCijXdrqxep0QnHCyjWutODcXCNXnitjJPAQLQ 7LhuiZX2A4VI8eeGZObjYSOTH8EJRVcnt8/wH1L5Ym6jdMw+n4g718x85+eZS8TyFvFT anu5Ahr1C8vv7+aVJxXMSwFs18GzEOr+/cv7E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3OSciSshxw1ajbuKC+nDurngCfD9G/F9+9W2Q6xNVPI=; b=VyRhbBpoFY8nXo2zf0tuQqwbIfaWKqskVCKDxb8Mi/sDBNBfcMUaXcsDl0XVsRK1MQ WGW4ArTBpHh5R38EfX+PpNEs/yAh3Kdcv8E6Z+BGD3dlxnDCbj/MvYZgrmV7wqvIVdmu qX/xGtog/0OV/mPbH4TLARIW1BYQiJmR0GDB8nslhYPPImICUcSKgnO2DxKjvK9kIqFa i2NgGGAOcxNiYM6ex+juqMVDc/Mz9WO5Vdp5lSOehK/+Py6I0ur569l1Nqn8cxT8Mnw+ G3CLfIylWkJn7KgEuuHehd2RJQVGepbqbZH6BrjyM7OAUEQS2m0um+jZoUteUmjQCv6Q v7fg== X-Gm-Message-State: ALoCoQlCxH3yYOI4U8r6yvT8VwSFbc7VFoTG+eeVyfvnxRuPjlQaFyQq14XpWDG/VsQYxEatct+H X-Received: by 10.66.251.101 with SMTP id zj5mr30051513pac.154.1399217204626; Sun, 04 May 2014 08:26:44 -0700 (PDT) Received: from djkurtzt530-glaptop.hitronhub.home (123-193-41-132.dynamic.kbronet.com.tw. [123.193.41.132]) by mx.google.com with ESMTPSA id ry10sm48005129pab.38.2014.05.04.08.26.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 May 2014 08:26:43 -0700 (PDT) From: Daniel Kurtz To: Inki Dae , Kukjin Kim Cc: Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , David Airlie , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, seanpaul@chromium.org, marcheu@chromium.org, Daniel Kurtz Subject: [PATCH 3/4] drm/exynos/mixer: planes are not disabled by setting dma_addr to zero Date: Sun, 4 May 2014 23:26:20 +0800 Message-Id: <1399217181-26442-4-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> References: <1399217181-26442-1-git-send-email-djkurtz@chromium.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Planes are disabled by calling the win_mode_disable() callback, not by calling win_mode_commit()[->vp_video_buffer] with dma_addr set to zero. Thus, the comment in the pixel_format switch default clause is obsolete, we should always check if the pixel_format is supported, and therefore, since the driver does not actually supported single-buffer formats, buf_num will always be 2, and we drop the broken 1-buffer case. Signed-off-by: Daniel Kurtz --- drivers/gpu/drm/exynos/exynos_mixer.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 40cf39b..b252ec7 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -382,7 +382,6 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) unsigned long flags; struct hdmi_win_data *win_data; unsigned int x_ratio, y_ratio; - unsigned int buf_num = 1; dma_addr_t luma_addr[2], chroma_addr[2]; bool tiled_mode = false; bool crcb_mode = false; @@ -393,16 +392,12 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) switch (win_data->pixel_format) { case DRM_FORMAT_NV12MT: tiled_mode = true; + /* fall through */ case DRM_FORMAT_NV12: crcb_mode = false; - buf_num = 2; break; /* TODO: single buffer format NV12, NV21 */ default: - /* ignore pixel format at disable time */ - if (!win_data->dma_addr) - break; - DRM_ERROR("pixel format for vp is wrong [%d].\n", win_data->pixel_format); return; @@ -412,14 +407,8 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) x_ratio = (win_data->src_width << 16) / win_data->crtc_width; y_ratio = (win_data->src_height << 16) / win_data->crtc_height; - if (buf_num == 2) { - luma_addr[0] = win_data->dma_addr; - chroma_addr[0] = win_data->chroma_dma_addr; - } else { - luma_addr[0] = win_data->dma_addr; - chroma_addr[0] = win_data->dma_addr - + (win_data->fb_width * win_data->fb_height); - } + luma_addr[0] = win_data->dma_addr; + chroma_addr[0] = win_data->chroma_dma_addr; if (win_data->scan_flags & DRM_MODE_FLAG_INTERLACE) { ctx->interlace = true;