From patchwork Thu Aug 9 18:24:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 10657 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 D802C23E02 for ; Thu, 9 Aug 2012 18:25:01 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id A78A5A185A0 for ; Thu, 9 Aug 2012 18:25:01 +0000 (UTC) Received: by ggnf1 with SMTP id f1so777166ggn.11 for ; Thu, 09 Aug 2012 11:25:01 -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=mr28lHlrM3vetFVSauLlPrADibovfDncM+OqhIUYIng=; b=dCUGEhTLzk+G6hTJHAYtnDzjbX/fGqDTHXNJ97b82YLwh60D9Fi0e5cJ5Ued83xpDK iNWG8GTDyFg+bEFKLQEsXRk6wLxecIMAYpv9Fzz6l3Uy/1m0/DIC/JBCjy9hH29nWrf6 jQBALKZxeVhoujnqW2u2Jt/FtsHmWElmvnrEdzOZw6ML5oOiFwEJAaLy733Rb1Pbb+0E vtqvn9btPP2CXkl/IccuGm1bqc7eONP4dHXwL0wMkgmGEqOuuohL9Rd/iwVG9CIAhZFG SwNXji0BpWH1o+7qHcIx2erYxTqu3JfFKrhKkwTtuToo+1yjeUYbUyfE+I5H50m2Y+83 KC8A== Received: by 10.50.94.133 with SMTP id dc5mr2158075igb.16.1344536700946; Thu, 09 Aug 2012 11:25:00 -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.184.200 with SMTP id ew8csp22663igc; Thu, 9 Aug 2012 11:25:00 -0700 (PDT) Received: by 10.60.1.165 with SMTP id 5mr189689oen.70.1344536700484; Thu, 09 Aug 2012 11:25:00 -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 m6si2137912oec.56.2012.08.09.11.25.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 11:25:00 -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 obbwd20 with SMTP id wd20so1278336obb.37 for ; Thu, 09 Aug 2012 11:25:00 -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=mr28lHlrM3vetFVSauLlPrADibovfDncM+OqhIUYIng=; b=psTbB2dCz47/IahL3/ftedtWYU4Qg7J5glXnB+3CmGZi3c0WwQZ6l0SVDlv8kHBOAD KBc0x3ohvpP6RH3mPoscjA9btajFuUyxDoef5zxMQVORDRi85U3Ly2aHno95gp9InGsP 1BCmQhPMNpb+C70ss/IiqZQpkn0TxBUK+aCX7a504l5xKwiqViduXLWxEFBjqstbEn3T AM0IlOxf3L/8rPTJTqcFrv7ipdEVgxX62o2uyp87U/NzruuG9rSb+rSgRMcfHzNVE4g3 twsRBZwMmpOFu33fLahQhwd1j6ZY6cn9GeBKA7nOQqqyj2HWhevHnITDcNfNKoMvTWlY M+qg== Received: by 10.182.49.7 with SMTP id q7mr224703obn.68.1344536700242; Thu, 09 Aug 2012 11:25:00 -0700 (PDT) Received: from localhost (ppp-70-129-143-140.dsl.rcsntx.swbell.net. [70.129.143.140]) by mx.google.com with ESMTPS id j10sm1052756oej.10.2012.08.09.11.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 11:24:59 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: wayland-devel@lists.freedesktop.org Cc: patches@linaro.org, Rob Clark Subject: [PATCH weston] compositor-drm: don't keep trying if hw doesn't support cursors Date: Thu, 9 Aug 2012 13:24:45 -0500 Message-Id: <1344536686-10598-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQm8LHxbf4e4i2aZm2XLJM5LUWNBbplZRSyEQQnzQ2wjKRV+U3y1jRKvxzb/gFw3YGwXOn1K From: Rob Clark Not all hw supports hw cursors. Similar to the case with sprites, if the driver does not support it, don't keep trying and spamming the log with error messages. Signed-off-by: Rob Clark --- src/compositor-drm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 32949cf..235beaf 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -77,6 +77,8 @@ struct drm_compositor { struct wl_list sprite_list; int sprites_are_broken; + int cursors_are_broken; + uint32_t prev_state; }; @@ -688,6 +690,8 @@ drm_output_set_cursor(struct weston_output *output_base, return; if (es->output_mask != (1u << output_base->id)) return; + if (c->cursors_are_broken) + return; if (es->buffer == NULL || !wl_buffer_is_shm(es->buffer) || es->geometry.width > 64 || es->geometry.height > 64) return; @@ -709,6 +713,7 @@ drm_output_set_cursor(struct weston_output *output_base, if (drmModeSetCursor(c->drm.fd, output->crtc_id, handle, 64, 64)) { weston_log("failed to set cursor: %m\n"); + c->cursors_are_broken = 1; return; } } @@ -718,6 +723,7 @@ drm_output_set_cursor(struct weston_output *output_base, if (output->cursor_x != x || output->cursor_y != y) { if (drmModeMoveCursor(c->drm.fd, output->crtc_id, x, y)) { weston_log("failed to move cursor: %m\n"); + c->cursors_are_broken = 1; return; } output->cursor_x = x;