From patchwork Mon May 27 15:44:57 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: 2620841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 06A8B3FD4E for ; Mon, 27 May 2013 15:46:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 082D3E606E for ; Mon, 27 May 2013 08:46:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D186E5FE9 for ; Mon, 27 May 2013 08:45:09 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 27 May 2013 08:43:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,751,1363158000"; d="scan'208";a="343898764" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga002.jf.intel.com with SMTP; 27 May 2013 08:45:02 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 27 May 2013 18:45:01 +0300 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/fb-helper: Don't load the display palette if the CRTC is disabled Date: Mon, 27 May 2013 18:44:57 +0300 Message-Id: <1369669497-18854-2-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1369669497-18854-1-git-send-email-ville.syrjala@linux.intel.com> References: <1369669497-18854-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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ä Often the hardware needs certain clocks running when accessing the palette, so don't go poking at it if the CRTC is disabled. We still call the fb_helper gamma_set hooks to update the driver's notion of what the palette should contain, so that if/when CRTC gets enabled, the driver will load the correct palette. Signed-off-by: Ville Syrjälä Acked-by: Daniel Vetter --- The other option would of course to put the check into the load_lut function itself. I don't really care which way we do it as long as the check is somewhere... drivers/gpu/drm/drm_fb_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 1b6ca23..4ecf128 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -663,7 +663,9 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) if (rc) goto out; } - crtc_funcs->load_lut(crtc); + + if (crtc->enabled) + crtc_funcs->load_lut(crtc); } out: drm_modeset_unlock_all(dev);