From patchwork Mon May 14 08:02:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10397397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A6CE6038F for ; Mon, 14 May 2018 08:03:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B75A1FE82 for ; Mon, 14 May 2018 08:03:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FA4528A04; Mon, 14 May 2018 08:03:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8782D2022B for ; Mon, 14 May 2018 08:03:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EECBF890A6; Mon, 14 May 2018 08:03:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F4D289AAD; Mon, 14 May 2018 08:02:59 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 11692948-1500050 for multiple; Mon, 14 May 2018 09:02:52 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Mon, 14 May 2018 09:02:53 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 14 May 2018 09:02:46 +0100 Message-Id: <20180514080251.11224-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.17.0 X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH i-g-t 1/6] overlay: Remove the miscalculation of window position X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We already call x11_position() to calculate the position of the overlay, so do not need to manually recompute them inside x11_overlay_create(). This has the advantage that x11_position() understands the multi-monitor layout instructions. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- overlay/x11/x11-overlay.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/overlay/x11/x11-overlay.c b/overlay/x11/x11-overlay.c index d08ebfc9c..ae6494295 100644 --- a/overlay/x11/x11-overlay.c +++ b/overlay/x11/x11-overlay.c @@ -271,22 +271,6 @@ x11_overlay_create(struct config *config, int *width, int *height) priv->x = x; priv->y = y; - if (position != POS_UNSET) { - switch (position & 7) { - default: - case 0: priv->x = 0; break; - case 1: priv->x = (scr->width - image->width)/2; break; - case 2: priv->x = scr->width - image->width; break; - } - - switch ((position >> 4) & 7) { - default: - case 0: priv->y = 0; break; - case 1: priv->y = (scr->height - image->height)/2; break; - case 2: priv->y = scr->height - image->height; break; - } - } - priv->image = image; priv->image->data = (void *)&priv->name;