From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915/pch: Fix integer math bugs in panel fitting Date: Thu, 21 Jul 2011 12:18:47 +0100 Message-ID: References: <1310589152-31945-1-git-send-email-ajax@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1779389230==" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 270A89E75D for ; Thu, 21 Jul 2011 04:18:55 -0700 (PDT) In-Reply-To: <1310589152-31945-1-git-send-email-ajax@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Adam Jackson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1779389230== Content-Type: text/plain On Wed, 13 Jul 2011 16:32:32 -0400, Adam Jackson wrote: > Consider a 1600x900 panel, upscaling a 1360x768 mode, full-aspect. The > old math would give you: > > scaled_width = 1600 * 768; /* 1228800 */ > scaled_height = 1360 * 900; /* 1224000 */ > if (scaled_width > scaled_height) { /* pillarbox, and true */ > width = 1224000 / 768; /* int(1593.75) = 1593 */ > x = (1600 - 1593 + 1) / 2; /* 4 */ > y = 0; > height = 768; > } /* ... */ > > This is broken. The total width of scanout would then be 1593 + 4 + 4, > or 1601, which is wider than the panel itself. The hardware very > dutifully implements this, and you end up with a black 45° diagonal from > the top-left corner to the bottom edge of the screen. It's a cool > effect and all, but not what you wanted. Similar things happen for the > letterbox case. I'm going to show my ignorance but why did the hw apply the offset to both sides of the output and generate a new mode line? That's probably inherent in the nature of the hblanks, I guess? The entirety of the description I have is that the position is simply the origin of the top-left pixel of the fitted window. So a comment here is necessary, but otherwise: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38851 Reviewed-by: Chris Wilson And a big thank you. -Chris -- Chris Wilson, Intel Open Source Technology Centre --===============1779389230== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1779389230==--