From patchwork Wed May 8 09:55:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 2538271 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 E7242DF2E5 for ; Wed, 8 May 2013 10:01:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2F6BE6314 for ; Wed, 8 May 2013 03:01:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C289E62D8; Wed, 8 May 2013 02:55:46 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 08 May 2013 02:55:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,632,1363158000"; d="scan'208";a="299316770" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by azsmga001.ch.intel.com with SMTP; 08 May 2013 02:55:40 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 08 May 2013 12:55:39 +0300 From: ville.syrjala@linux.intel.com To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/7] drm/i915: Use a custom restore_fbdev_mode hook Date: Wed, 8 May 2013 12:55:19 +0300 Message-Id: <1368006922-24957-5-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1368006922-24957-1-git-send-email-ville.syrjala@linux.intel.com> References: <1368006922-24957-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Cc: dri-devel@lists.freedesktop.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: , 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: Ville Syrjälä Disable sprite planes and cursors when restoring the fbdev mode. This is actually only needed in case the modeset gets optimized into a set_base, but that's a fairly important case these days. Should makes oopses more readable if they're not covered by spriteas and cursors. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_fb.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 57a082c..a9e9fc0 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -183,11 +183,26 @@ out: return ret; } +static bool intel_fb_restore_fbdev_mode(struct drm_fb_helper *helper) +{ + struct drm_device *dev = helper->dev; + bool ret; + + ret = drm_fb_helper_restore_fbdev_mode(helper); + if (ret) + DRM_DEBUG("failed to restore crtc mode\n"); + + /* in case we ended up doing just set_base above */ + intel_disable_cursors_and_sprites(dev); + + return ret; +} + static struct drm_fb_helper_funcs intel_fb_helper_funcs = { .gamma_set = intel_crtc_fb_gamma_set, .gamma_get = intel_crtc_fb_gamma_get, .fb_probe = intelfb_create, - .restore_fbdev_mode = drm_fb_helper_restore_fbdev_mode, + .restore_fbdev_mode = intel_fb_restore_fbdev_mode, }; static void intel_fbdev_destroy(struct drm_device *dev, @@ -279,7 +294,6 @@ void intel_fb_output_poll_changed(struct drm_device *dev) void intel_fb_restore_mode(struct drm_device *dev) { - int ret; drm_i915_private_t *dev_priv = dev->dev_private; if (INTEL_INFO(dev)->num_pipes == 0) @@ -287,12 +301,7 @@ void intel_fb_restore_mode(struct drm_device *dev) drm_modeset_lock_all(dev); - ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); - if (ret) - DRM_DEBUG("failed to restore crtc mode\n"); - - /* in case we ended up doing just set_base above */ - intel_disable_cursors_and_sprites(dev); + intel_fb_restore_fbdev_mode(&dev_priv->fbdev->helper); drm_modeset_unlock_all(dev); }