From patchwork Wed Nov 18 11:49:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nabendu Maiti X-Patchwork-Id: 7648301 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5E1069F1C2 for ; Wed, 18 Nov 2015 11:39:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CB33205FF for ; Wed, 18 Nov 2015 11:39:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9EE44205FA for ; Wed, 18 Nov 2015 11:39:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 175D66E194; Wed, 18 Nov 2015 03:39:27 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DE2D6E194 for ; Wed, 18 Nov 2015 03:39:26 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Nov 2015 03:39:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,312,1444719600"; d="scan'208";a="602479320" Received: from dispdev.iind.intel.com ([10.223.25.80]) by FMSMGA003.fm.intel.com with ESMTP; 18 Nov 2015 03:39:24 -0800 From: Nabendu Maiti To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Nov 2015 17:19:26 +0530 Message-Id: <1447847366-2431-1-git-send-email-nabendu.bikash.maiti@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] drm/i915: Correcting proper src & dst height - width comparision for 90/270 rotation. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 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 On 90/270 rotation case source width and height was not compared properly with destination height and width check plane.Which added erroneous check while doing scaling or normal 90/270 rotation. Signed-off-by: Nabendu Maiti --- drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 688d484..cd5bb28 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13723,6 +13723,9 @@ intel_check_primary_plane(struct drm_plane *plane, int min_scale = DRM_PLANE_HELPER_NO_SCALING; int max_scale = DRM_PLANE_HELPER_NO_SCALING; bool can_position = false; + struct drm_rect *src = &state->src; + struct drm_rect *dest = &state->dst; + int ret = -1; /* use scaler when colorkey is not required */ if (INTEL_INFO(plane->dev)->gen >= 9 && @@ -13732,11 +13735,26 @@ intel_check_primary_plane(struct drm_plane *plane, can_position = true; } - return drm_plane_helper_check_update(plane, crtc, fb, &state->src, - &state->dst, &state->clip, + /* + * FIXME the following code does a bunch of fuzzy adjustments to the + * coordinates and sizes for rotations. We probably need some way to + * decide whether more strict checking should be done instead. + */ + if (fb) + drm_rect_rotate(src, fb->width << 16, fb->height << 16, + state->base.rotation); + + ret = drm_plane_helper_check_update(plane, crtc, fb, src, + dest, &state->clip, min_scale, max_scale, can_position, true, &state->visible); + + /* Restore the originl unrotated co-ordinates */ + if (fb) + drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, + state->base.rotation); + return ret; } static void