From patchwork Wed Mar 9 15:57:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8547201 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC02BC0553 for ; Wed, 9 Mar 2016 15:59:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0970420295 for ; Wed, 9 Mar 2016 15:59:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2AAF52026F for ; Wed, 9 Mar 2016 15:59:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 426E76E88F; Wed, 9 Mar 2016 15:59:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27F5C6E536 for ; Wed, 9 Mar 2016 15:58:18 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id p65so10965499wmp.1 for ; Wed, 09 Mar 2016 07:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=16UUsKmdQ53Slvy/+cLdW6o98N0gdGOHX+vVB2pWQ/g=; b=jW9umYstghIS95cbRbtuCiTWCttV4a5F5SSgfdwU8LNfxRoir4PYjYjnrs7jLOayvQ BmJregl+7X/KSYeou8MHWUe6rL2tuI8Fat1Zex4UdHh6hmCd6N77fBgno+1sPBrgUKs/ ieanb8pQKYRN2Rufm8XtFIQ2YB95JQN/H5zJAWE77bW6x2FChLpOsWjMkVx4sUQdpGj8 F6/a/G9cR/gKcN3CYGj8D9fkRSP8ExB9j0I0PYTh01BMvEa2HZTUwn96srY584Jq0ucF e2wEPW8LkKF8yHNXOW8yCSG6BB7/1JfoIuEEAjpUl5Vu7HkLACwS/T09mAcX/EEfnJmx a3iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=16UUsKmdQ53Slvy/+cLdW6o98N0gdGOHX+vVB2pWQ/g=; b=CNdUEZmpvhcCxX6BUi4JJ4SjwG4ir6+7blupdWBhfLCfo15I7+8Rl1n5ztn15hHujb WFFz6g4qE6m3AfLenzyHW4pu+D8uVKb+iBsP19Vs9QCGfnRYXGOOE7NZV59q8mDaDzHf a9eT/0qbLyRVzXkaQ3wxJ707yXJZN1kgxSc1Q0gBtmf0nvJeBYhV9rD3jQKnreA6Rmji yMPB6cW1bkcvrjj0VYKeycB7Pq9v/E83wt11GQOcvLwCDoiubQ7cRl6H/Ga1W336Mqx0 vUTZ2NQqIPgAx1MYiR0TuIQm+Y8lTRFeUtmKP9SjqnxbX1vQSpW4DzYqJ6Tn7FP1tS5i bWwg== X-Gm-Message-State: AD7BkJK9rF/7FA/4Ba0Y17vCVpMusc3YVlSaxB3BiRhpLxUj0KM8NaNuU0zYjEBn9O1Efg== X-Received: by 10.28.22.74 with SMTP id 71mr26206271wmw.47.1457539096359; Wed, 09 Mar 2016 07:58:16 -0800 (PST) Received: from cizrna.lan ([109.72.12.208]) by smtp.gmail.com with ESMTPSA id j18sm24649544wmd.2.2016.03.09.07.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 07:58:15 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Wed, 9 Mar 2016 16:57:38 +0100 Message-Id: <1457539058-5782-3-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457539058-5782-1-git-send-email-tomeu.vizoso@collabora.com> References: <1457539058-5782-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Daniel Stone , Tomeu Vizoso , Micah Fedke , Gustavo Padovan , Emil Velikov Subject: [Intel-gfx] [i-g-t PATCH v2 2/2] overlay: Remove crtc<->pipe mapping code from kms-overlay 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: Micah Fedke the crtc id is now always equivalent to its index in the array of crtcs returned by the kernel Signed-off-by: Micah Fedke [tomeu: Fixed include path and removed some dead code] Signed-off-by: Tomeu Vizoso --- Changes in v2: - Fix include path as suggested by Thomas - Remove some dead code overlay/Makefile.am | 4 ++-- overlay/kms/kms-overlay.c | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/overlay/Makefile.am b/overlay/Makefile.am index c648875d24a7..eed2f9293ce0 100644 --- a/overlay/Makefile.am +++ b/overlay/Makefile.am @@ -3,8 +3,8 @@ bin_PROGRAMS = intel-gpu-overlay endif AM_CPPFLAGS = -I. -AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) -LDADD = $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS) +AM_CFLAGS = -I$(top_srcdir)/lib $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(OVERLAY_CFLAGS) +LDADD = $(top_builddir)/lib/libintel_tools.la $(LIBUNWIND_LIBS) $(DRM_LIBS) $(PCIACCESS_LIBS) $(CAIRO_LIBS) $(OVERLAY_LIBS) intel_gpu_overlay_SOURCES = \ i915_pciids.h \ diff --git a/overlay/kms/kms-overlay.c b/overlay/kms/kms-overlay.c index cfb3d5ae1dd7..494d57eeeb6b 100644 --- a/overlay/kms/kms-overlay.c +++ b/overlay/kms/kms-overlay.c @@ -38,6 +38,7 @@ #include #include #include "../overlay.h" +#include "igt_kms.h" //#include "rgb2yuv.h" #ifndef ALIGN @@ -240,20 +241,11 @@ kms_overlay_create(struct config *config, int *width, int *height) priv->crtc = 0; for (i = 0; i < kmode->count_crtcs; i++) { - struct drm_i915_get_pipe_from_crtc_id get_pipe; - - get_pipe.pipe = 0; - get_pipe.crtc_id = kmode->crtcs[i]; - if (drmIoctl(priv->fd, - DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, - &get_pipe)) { - continue; - } - - if (get_pipe.pipe != pipe) + if (kmstest_get_pipe_from_crtc_id(priv->fd, + kmode->crtcs[i]) != pipe) continue; - priv->crtc = get_pipe.crtc_id; + priv->crtc = kmode->crtcs[i]; } if (priv->crtc == 0)