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: 12219 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D527023EF8 for ; Sun, 14 Oct 2012 21:57:37 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6AA29A18DC4 for ; Sun, 14 Oct 2012 21:57:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6812277iej.11 for ; Sun, 14 Oct 2012 14:57:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=MThfXvVIeFzcJOulQy4Nib4H2JLPKGCEQjgJzlYTjp8=; b=XVlus+IG8z0K2/tK7vXCa76eAEwjAFpYDjd5neQgTiTvCHKNNa0igeujKpIg0ZHB6F biDidraOP/wxE04SLEphTdn3MwAZX6r4uwTCxkOWb+qWCeQz/yptRCL8BMIlEict9J0b kfkgl7fZcEANB242PVLSk7Fe2pYUZaVxVzhl3DijHN16kme5qowxsYM0PLYdibVxnNGv ONmhV+4CvUoiSFpBNiwWNOV1i8XHuQFfXXD/sbXySXPkU6s8/VRwaiTim/YBI3b25uJF aHpHbpaEb56cgL4ZyiaRy6hC+z3KNZCAekYk1GBoJb8Ff+UWlHq0xgzuzU85waTZzreR WZqA== Received: by 10.50.91.195 with SMTP id cg3mr7162066igb.57.1350251856765; Sun, 14 Oct 2012 14:57:36 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp493986igt; Sun, 14 Oct 2012 14:57:36 -0700 (PDT) Received: by 10.182.207.71 with SMTP id lu7mr7952963obc.78.1350251855884; Sun, 14 Oct 2012 14:57:35 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id c7si14803933obv.60.2012.10.14.14.57.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Oct 2012 14:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-ob0-f178.google.com with SMTP id tb18so5380858obb.37 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) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Rob Clark 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 X-Gm-Message-State: ALoCoQnPlK6dhvsXLwoLhEwHxojHDC4AiU46sTX35bjlcRs5824nfEw0tCeEencRuqx07i7ifVUD 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;