From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/fb-helper: Don't load the display palette if the CRTC is disabled Date: Mon, 27 May 2013 17:54:37 +0200 Message-ID: <20130527155437.GR15743@phenom.ffwll.local> References: <1369669497-18854-1-git-send-email-ville.syrjala@linux.intel.com> <1369669497-18854-2-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by gabe.freedesktop.org (Postfix) with ESMTP id CD133E5DFF for ; Mon, 27 May 2013 08:54:41 -0700 (PDT) Received: by mail-ea0-f182.google.com with SMTP id r16so4137610ead.13 for ; Mon, 27 May 2013 08:54:41 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1369669497-18854-2-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, May 27, 2013 at 06:44:57PM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > 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=E4l=E4 > --- > 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_hel= per.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, struc= t fb_info *info) > if (rc) > goto out; > } > - crtc_funcs->load_lut(crtc); > + > + if (crtc->enabled) I'd vote for if (crtc->enabled && crtc_funcs->load_lut) since a lot of kms drivers only implement dummy ->load_lut functions. Then please also throw a pile of driver patches on top to kill all the now redundant crtc->enabled checks and all the dummy load_lut functions. With that fixed this is Acked-by: Daniel Vetter > + crtc_funcs->load_lut(crtc); > } > out: > drm_modeset_unlock_all(dev); > -- = > 1.8.1.5 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch