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: 4107621 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 C6F02BFF02 for ; Sun, 4 May 2014 15:26:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E68CF20225 for ; Sun, 4 May 2014 15:26:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1601220148 for ; Sun, 4 May 2014 15:26:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 567D36E5F4; Sun, 4 May 2014 08:26:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AFA16E5FB for ; Sun, 4 May 2014 08:26:45 -0700 (PDT) Received: by mail-pa0-f41.google.com with SMTP id lj1so5355673pab.28 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=JuDV/OBhi78HTZaSdo5k4a7gKcnPcSu/ermtyWs5xa48FYVMkLtc/dPvHddvhYNbwx hbrQP0Gs127K8MM/NBHzKxSi0SlM9nNU1vKQ28tHBkXcAjGvDdF1RqM/riidjYSljCD8 kSi+90BYTrnjPovhqU+Uomq75PTTNAJQ/z9Jv/qJwN98P94H7OQl07GajoL/5ctSp7wl SfJfiM36idpTrwW8NhODVFSQ6hxv++4KOjYNQA3Ff/KViDCE1UQaE4yTUcG5k71gCGYj bZJmFnJfNg/TrL7+skhijkw2HaNa8R1MpqClPD52mqqOia8n4oCjxBMd/4qx/TN7rWsH niJg== X-Gm-Message-State: ALoCoQn6cfqqv2MsU9+9ArWkARBM/6tTeDvQ82vmNADMiNOAMHI9Y/NZ1yG/CtylBIqnbR8nM2oV 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 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> Cc: linux-samsung-soc@vger.kernel.org, Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , marcheu@chromium.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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;