drm: i915: remove dead code and pointless local lut storage
authorPeter Rosin <peda@axentia.se>
Thu, 13 Jul 2017 16:25:33 +0000 (18:25 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 4 Aug 2017 09:35:56 +0000 (11:35 +0200)
The driver stores lut values from the fbdev interface, and is able
to give them back, but does not appear to do anything with these
lut values. The generic fb helpers have replaced this function,
and may even have made the driver work for the C8 mode from the
fbdev interface. But that is untested.

Since the fb helpers .gamma_set and .gamma_get are obsolete,
remove the dead code.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170713162538.22788-10-peda@axentia.se
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_fbdev.c

index d17a32437f0747264a90216a792416022d99a7b9..210a8c63bde84813281fbbfc157dcc45413806f6 100644 (file)
@@ -786,7 +786,6 @@ struct intel_crtc {
        struct drm_crtc base;
        enum pipe pipe;
        enum plane plane;
-       u8 lut_r[256], lut_g[256], lut_b[256];
        /*
         * Whether the crtc and the connected output pipeline is active. Implies
         * that crtc->enabled is set, i.e. the current mode configuration has
index b953365a3eec8bc4f02f9b2acadadda9501b42a8..0986ca4f16f1a3b2b9d5f49d42986d76a76f68a9 100644 (file)
@@ -280,27 +280,6 @@ out_unlock:
        return ret;
 }
 
-/** Sets the color ramps on behalf of RandR */
-static void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
-                                   u16 blue, int regno)
-{
-       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-
-       intel_crtc->lut_r[regno] = red >> 8;
-       intel_crtc->lut_g[regno] = green >> 8;
-       intel_crtc->lut_b[regno] = blue >> 8;
-}
-
-static void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
-                                   u16 *blue, int regno)
-{
-       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-
-       *red = intel_crtc->lut_r[regno] << 8;
-       *green = intel_crtc->lut_g[regno] << 8;
-       *blue = intel_crtc->lut_b[regno] << 8;
-}
-
 static struct drm_fb_helper_crtc *
 intel_fb_helper_crtc(struct drm_fb_helper *fb_helper, struct drm_crtc *crtc)
 {
@@ -375,7 +354,6 @@ retry:
                struct drm_connector *connector;
                struct drm_encoder *encoder;
                struct drm_fb_helper_crtc *new_crtc;
-               struct intel_crtc *intel_crtc;
 
                fb_conn = fb_helper->connector_info[i];
                connector = fb_conn->connector;
@@ -417,13 +395,6 @@ retry:
 
                num_connectors_enabled++;
 
-               intel_crtc = to_intel_crtc(connector->state->crtc);
-               for (j = 0; j < 256; j++) {
-                       intel_crtc->lut_r[j] = j;
-                       intel_crtc->lut_g[j] = j;
-                       intel_crtc->lut_b[j] = j;
-               }
-
                new_crtc = intel_fb_helper_crtc(fb_helper,
                                                connector->state->crtc);
 
@@ -526,8 +497,6 @@ bail:
 
 static const struct drm_fb_helper_funcs intel_fb_helper_funcs = {
        .initial_config = intel_fb_initial_config,
-       .gamma_set = intel_crtc_fb_gamma_set,
-       .gamma_get = intel_crtc_fb_gamma_get,
        .fb_probe = intelfb_create,
 };