From patchwork Sun Oct 14 21:57:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1591781 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id BB00CE00AD for ; Sun, 14 Oct 2012 21:57:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A8DF9EC9B for ; Sun, 14 Oct 2012 14:57:47 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by gabe.freedesktop.org (Postfix) with ESMTP id EBE6C9E797 for ; Sun, 14 Oct 2012 14:57:35 -0700 (PDT) Received: by mail-ob0-f177.google.com with SMTP id wd20so4589390obb.36 for ; Sun, 14 Oct 2012 14:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=MThfXvVIeFzcJOulQy4Nib4H2JLPKGCEQjgJzlYTjp8=; b=0xmFu96qS1DvrzbpN5RL+/XhE6fpRK8EOdL0CR75T1Nn9ISDXO5Nyy1IztRqcqeny1 EqtmaIMbOIYp6o8OFABgc04zRElMVhJUuyryeNXfWizC6I9FfdyBIwAAU55/Pmsl19Oe CE3XG+skAYRVHmWzSPw9B3FWH+qUOfb7buSUC0oDcw6Ir5BS9eIieFiOYusCACgK4p3H lNHUH70XnzSgmaFC7WLi2PmgoRnnilluH6eg+sC3MmaSte5ak23WjZdlR0rsiZYURYgY 5pvO9HnVjzAM0abS8ZWzvKHaip7oGt1ywml/S7WzV6pH4uZuYwKiBaWcdP15iKMY2NUn +Dqw== Received: by 10.60.170.43 with SMTP id aj11mr8386280oec.71.1350251855273; Sun, 14 Oct 2012 14:57:35 -0700 (PDT) Received: from localhost (ppp-70-129-143-201.dsl.rcsntx.swbell.net. [70.129.143.201]) by mx.google.com with ESMTPS id 3sm10139602oee.13.2012.10.14.14.57.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Oct 2012 14:57:34 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] initialize width/height fields in drmModeCrtc Date: Sun, 14 Oct 2012 16:57:31 -0500 Message-Id: <1350251851-22403-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 Cc: Rob Clark , patches@linaro.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 From: Rob Clark If we have valid timings, we can at least set width/height to *something*, which is I think at least less confusing than always seeing width/height of zero. At least modeprint and modetest seem to expect width/height to mean something. Signed-off-by: Rob Clark --- xf86drmMode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index 04fdf1f..f603ceb 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -351,8 +351,11 @@ drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId) r->x = crtc.x; r->y = crtc.y; r->mode_valid = crtc.mode_valid; - if (r->mode_valid) + if (r->mode_valid) { memcpy(&r->mode, &crtc.mode, sizeof(struct drm_mode_modeinfo)); + r->width = crtc.mode.hdisplay; + r->height = crtc.mode.vdisplay; + } r->buffer_id = crtc.fb_id; r->gamma_size = crtc.gamma_size; return r;