From patchwork Sat Jul 17 19:23:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 112571 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6HJO1th022504 for ; Sat, 17 Jul 2010 19:24:36 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 489549E87A for ; Sat, 17 Jul 2010 12:24:01 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 81FA89E8BE; Sat, 17 Jul 2010 12:23:31 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 17 Jul 2010 12:22:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,219,1278313200"; d="scan'208";a="639356904" Received: from unknown (HELO broadwater.alporthouse.com) ([10.255.17.84]) by orsmga001.jf.intel.com with ESMTP; 17 Jul 2010 12:23:27 -0700 From: Chris Wilson To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Sat, 17 Jul 2010 20:23:26 +0100 Message-Id: <1279394606-15714-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.1 Cc: Dave Airlie Subject: [Intel-gfx] [PATCH 1/2] drm: Return EBUSY if the framebuffer is unbound when flipping. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 17 Jul 2010 19:24:36 +0000 (UTC) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 0371a2f..d9d5e9f 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2610,6 +2610,15 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, goto out; crtc = obj_to_crtc(obj); + if (crtc->fb == NULL) { + /* The framebuffer is currently unbound, presumably + * due to a hotplug event, that userspace has not + * yet discovered. + */ + ret = -EBUSY; + goto out; + } + if (crtc->funcs->page_flip == NULL) goto out;