From patchwork Thu Aug 8 13:41:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2841241 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 D9A489F294 for ; Thu, 8 Aug 2013 14:23:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2A23204D7 for ; Thu, 8 Aug 2013 14:23:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA293204E4 for ; Thu, 8 Aug 2013 14:23:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D8EEE67B1 for ; Thu, 8 Aug 2013 07:23:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 79D95E6853 for ; Thu, 8 Aug 2013 06:42:10 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id d41so1517951eek.22 for ; Thu, 08 Aug 2013 06:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GRrQai6cmxzmKXdRgnXsQ8epZORThZzrlYCPfABMETw=; b=Jfn2HWprB5CKSaHqFfO6AKrzTs7lQUd2202TSgWIeW0htzqCEw53pTJx0SEnWhhpGX 5M5vC5fGqkImdDjBOz3HMLLYhBSvFlhOK3hQN0Zr0uDGn1fKznvjdVD5RT26niwcyLZ+ u+cvsPsTpTofspgPZjUc7Grgvw/3hCOCXNo8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GRrQai6cmxzmKXdRgnXsQ8epZORThZzrlYCPfABMETw=; b=GIVNGlwz4uoHXnsyx5RJKubHKByNV+b2EZWggeTW9PtoQGKpyZfuqw5tn3DMgREedq DpVV4H3Oj3JBbZ5yles/tRrHS73EVPUs/4Erz1lZaVPtw3GN6+RqY56TW4WP+BRa7NGv yCwWj5uODrrXgoEIL3/+kmd2s8lZjBedDCJHq2Cp9dPwJG1wzZv2zdoHdm5DNajh+tyJ UCUCRtCrOqqNiJvhwvrVALDkiadhl7LYiNhGCYYlnNlp2MgnSyaTWz4XI2kUmDCODxMp 2tX0u9Bofy60o3TRO1YlBDFYWG5YT5GTr4BQ6q6E2bgShNUt+91WtltSrSbYSSurN7Uq fFYA== X-Gm-Message-State: ALoCoQlPzHdmbavgJKIInXY6ZNa/b3KH7O+NjOzeCCCl0ax2LTubC6ASp7iVAXV0HZAT/N1lFL1y X-Received: by 10.15.63.8 with SMTP id l8mr8371479eex.23.1375969329770; Thu, 08 Aug 2013 06:42:09 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id bn13sm19282226eeb.11.2013.08.08.06.42.08 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:42:08 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 22/25] drm: no-op out GET_STATS ioctl Date: Thu, 8 Aug 2013 15:41:32 +0200 Message-Id: <1375969295-18929-23-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1375969295-18929-1-git-send-email-daniel.vetter@ffwll.ch> References: <1375969295-18929-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Again only used by a tests in libdrm and by dristat. Nowadays we have much better tracing tools to get detailed insights into what a drm driver is doing. And for a simple "does it work" kind of question that these stats could answer we have plenty of dmesg debug log spew. So I don't see any use for this stat gathering complexity at all. To be able to gradually drop things start with ripping out the interfaces to it, here the ioctl. To prevent dristat from eating its own stack garbage we can't use the drm_noop ioctl though, since we need to clear the return data with a memset. Cc: Eric Anholt Signed-off-by: Daniel Vetter Reviewed-by: Eric Anholt --- drivers/gpu/drm/drm_ioctl.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index ac8ca5c..cffc7c0 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -257,21 +257,10 @@ int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_stats *stats = data; - int i; + /* Clear stats to prevent userspace from eating its stack garbage. */ memset(stats, 0, sizeof(*stats)); - for (i = 0; i < dev->counters; i++) { - if (dev->types[i] == _DRM_STAT_LOCK) - stats->data[i].value = - (file_priv->master->lock.hw_lock ? file_priv->master->lock.hw_lock->lock : 0); - else - stats->data[i].value = atomic_read(&dev->counts[i]); - stats->data[i].type = dev->types[i]; - } - - stats->count = dev->counters; - return 0; }