From patchwork Wed Jun 26 21:55:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2788951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F33A49F245 for ; Wed, 26 Jun 2013 22:08:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2972220214 for ; Wed, 26 Jun 2013 22:08:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5785B2020A for ; Wed, 26 Jun 2013 22:08:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38E05E6278 for ; Wed, 26 Jun 2013 15:08:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gh0-f170.google.com (mail-gh0-f170.google.com [209.85.160.170]) by gabe.freedesktop.org (Postfix) with ESMTP id C83BCE5DF4; Wed, 26 Jun 2013 14:55:49 -0700 (PDT) Received: by mail-gh0-f170.google.com with SMTP id z10so4812616ghb.29 for ; Wed, 26 Jun 2013 14:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=7+NlybvmYG1DI6icLNx6DnlnfFF2pQuPyRiU5ecft0o=; b=WWLmHR4FpZbzQ1wHbCXvWmMQIZTfmXGO79yvc4wKLChLWnK0L24dKrWb96leJBPqpo 5LXs+HsEdEKRV/WtMdfCWHdWH6+ar40lPAMxuQmTF8H1sYxNb61GEb/Z6PFsgoZzgVsa V++0zNPk1m1rhV+/oSbl8YPYkx5y0eOAvEV3ZyMkxTc7tDTRcjd0ClyLfEO4WW7IVFub V09ZH91eNxu9rOwhAiXXvxYVlUnBzS7nELRwRIPRS/2fEKkmAAsJYwo2Y4BON8JuSrsd OdW3GO07y108QcW6SyAvHG8MaoxwS0QtvO9aMT5HykE6FkOjpisv3LwPcmmd5RBM66g9 qXGw== X-Received: by 10.236.126.47 with SMTP id a35mr3127895yhi.45.1372283749489; Wed, 26 Jun 2013 14:55:49 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id d91sm47861367yhq.16.2013.06.26.14.55.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Jun 2013 14:55:49 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 09/11] drm/i915: Adding global I915_PARAM for PSR ACTIVE. Date: Wed, 26 Jun 2013 18:55:20 -0300 Message-Id: <1372283722-12988-9-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372283722-12988-1-git-send-email-rodrigo.vivi@gmail.com> References: <1372283722-12988-1-git-send-email-rodrigo.vivi@gmail.com> Cc: dri-devel@lists.freedesktop.org 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 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This global value allows userspace know when PSR is enabled and active, i.e. in SRD entry state. This will allow userspace emit more busy_ioctl when doing directly copy_area operations through scanout allowing forced psr exit. Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_dma.c | 3 +++ include/uapi/drm/i915_drm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index adb319b..de20c4a 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1000,6 +1000,9 @@ static int i915_getparam(struct drm_device *dev, void *data, case I915_PARAM_HAS_EXEC_HANDLE_LUT: value = 1; break; + case I915_PARAM_PSR_ACTIVE: + value = I915_READ(EDP_PSR_STATUS_CTL) & EDP_PSR_STATUS_STATE_SRDENT; + break; default: DRM_DEBUG("Unknown parameter %d\n", param->param); return -EINVAL; diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 923ed7f..191a7fc 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -310,6 +310,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_PINNED_BATCHES 24 #define I915_PARAM_HAS_EXEC_NO_RELOC 25 #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 +#define I915_PARAM_PSR_ACTIVE 27 typedef struct drm_i915_getparam { int param;