From patchwork Fri Dec 14 06:48:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 1877461 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id B097C3FC64 for ; Fri, 14 Dec 2012 06:50:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92674E6824 for ; Thu, 13 Dec 2012 22:50:30 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id E5838E682A for ; Thu, 13 Dec 2012 22:48:17 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MF000H63DIDQBP0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 14 Dec 2012 15:48:16 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.42]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 0F.F4.12699.0BBCAC05; Fri, 14 Dec 2012 15:48:16 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-fe-50cacbb013c3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 7E.F4.12699.0BBCAC05; Fri, 14 Dec 2012 15:48:16 +0900 (KST) Received: from localhost.localdomain ([10.90.51.60]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MF000FDIDKFVVD2@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 14 Dec 2012 15:48:15 +0900 (KST) From: Joonyoung Shim To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm/exynos: fix x, y coordinates for right bottom pixel Date: Fri, 14 Dec 2012 15:48:23 +0900 Message-id: <1355467705-12264-3-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1355467705-12264-1-git-send-email-jy0922.shim@samsung.com> References: <1355467705-12264-1-git-send-email-jy0922.shim@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNLMWRmVeSWpSXmKPExsVy+t8zLd0Np08FGDxuErW48vU9mwOjx/3u 40wBjFFcNimpOZllqUX6dglcGV/OHGAr+MdbMeXEJ+YGxkvcXYwcHBICJhLveyu6GDmBTDGJ C/fWs3UxcnEICSxjlPjeOZ8FImEisXPmV1aIxHRGif0N/1kgnBVMEqs3bGQCqWIT0JO4s+04 mC0ioCzxd+IqRhCbWcBYomP+F1YQW1jAR+LKxC52EJtFQFVi6Zb1YDavgLvEg0UrGCEuUpCY M8kGJMwp4CGxr+EU2EghoJKG9V+YIFoFJL5NPsQCUS4rsekAM8g5EgLX2SQ6jv9lhDhaUuLg ihssExiFFzAyrGIUTS1ILihOSs810itOzC0uzUvXS87P3cQICUHpHYyrGiwOMQpwMCrx8H4Q OhUgxJpYVlyZe4hRgoNZSYRX8ghQiDclsbIqtSg/vqg0J7X4EKMP0CUTmaVEk/OB8ZFXEm9o bGBsaGhpaGZqaWqAQ1hJnLfZIyVASCA9sSQ1OzW1ILUIZhwTB6dUA2Njc9qfb5fv3ohP+Xbh b8OSRCMroYOaxSrer/1dXG0jvpq3vdXJkpp2dGnz1ZgJ3+Pubtq/8NeZpPyTt1uViiYnScT+ jWm7/+6noBNjTuqWh8yum1bGNHwxWHz43dPQyEsO7zcuKp+zad69D50vv5pK5l5M2j7vgPb1 CutpX70+Hl875Yrkmn+/lFiKMxINtZiLihMBLWMF8G4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+xoO6G06cCDOZs5LW48vU9mwOjx/3u 40wBjFENjDYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5 QGOVFMoSc0qBQgGJxcVK+naYJoSGuOlawDRG6PqGBMH1GBmggYR1jBlfzhxgK/jHWzHlxCfm BsZL3F2MnBwSAiYSO2d+ZYWwxSQu3FvP1sXIxSEkMJ1RYn/DfxYIZwWTxOoNG5lAqtgE9CTu bDsOZosIKEv8nbiKEcRmFjCW6Jj/BWySsICPxJWJXewgNouAqsTSLevBbF4Bd4kHi1YA1XMA bVOQmDPJBiTMKeAhsa/hFNhIIaCShvVfmCYw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpec n7uJERziz6R3MK5qsDjEKMDBqMTD+0HoVIAQa2JZcWXuIUYJDmYlEV7JI0Ah3pTEyqrUovz4 otKc1OJDjD5AR01klhJNzgfGX15JvKGxiZmRpZGZsYm5sTEOYSVx3maPlAAhgfTEktTs1NSC 1CKYcUwcnFINjCHL78k+Dt9hOUfk/hVN0TTx65ab/GdujYjmmzmBWzNALV5P1qvowNc959YW /rTRYF2gkhOq0v+y1nLtGkfzaccZ5u3dENX8aNoWP2aN+Runz5mU+Nj73tcjTur2vH73fXIn VBvIu8yVZemuePyQs+TV1CX7/5qu4v+0tqFwu/SypzPz57KWfFJiKc5INNRiLipOBAB04tCb ngIAAA== X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com 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 The x, y coordinates of right bottom pixel cannot be negative numbers. Signed-off-by: Joonyoung Shim Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 90ca4b2..ae0153b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -471,6 +471,8 @@ static void fimd_win_commit(struct device *dev, int zpos) struct fimd_win_data *win_data; int win = zpos; unsigned long val, alpha, size; + unsigned int last_x; + unsigned int last_y; DRM_DEBUG_KMS("%s\n", __FILE__); @@ -524,16 +526,18 @@ static void fimd_win_commit(struct device *dev, int zpos) VIDOSDxA_TOPLEFT_Y(win_data->offset_y); writel(val, ctx->regs + VIDOSD_A(win)); - val = VIDOSDxB_BOTRIGHT_X(win_data->offset_x + - win_data->ovl_width - 1) | - VIDOSDxB_BOTRIGHT_Y(win_data->offset_y + - win_data->ovl_height - 1); + last_x = win_data->offset_x + win_data->ovl_width; + if (last_x) + last_x--; + last_y = win_data->offset_y + win_data->ovl_height; + if (last_y) + last_y--; + + val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y); writel(val, ctx->regs + VIDOSD_B(win)); DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n", - win_data->offset_x, win_data->offset_y, - win_data->offset_x + win_data->ovl_width - 1, - win_data->offset_y + win_data->ovl_height - 1); + win_data->offset_x, win_data->offset_y, last_x, last_y); /* hardware window 0 doesn't support alpha channel. */ if (win != 0) {