#include "core_status.h"
 #include "core_types.h"
 #include "hw_sequencer.h"
+#include "dce/dce_hwseq.h"
 
 #include "resource.h"
 
                 */
                update_flags->bits.bpp_change = 1;
 
+       if (u->gamma && dce_use_lut(u->plane_info->format))
+               update_flags->bits.gamma_change = 1;
+
        if (memcmp(&u->plane_info->tiling_info, &u->surface->tiling_info,
                        sizeof(union dc_tiling_info)) != 0) {
                update_flags->bits.swizzle_change = 1;
 
        if (update_flags->bits.rotation_change
                        || update_flags->bits.stereo_format_change
+                       || update_flags->bits.gamma_change
                        || update_flags->bits.bpp_change
                        || update_flags->bits.bandwidth_change)
                return UPDATE_TYPE_FULL;
        elevate_update_type(&overall_type, type);
 
        if (u->in_transfer_func)
-               update_flags->bits.in_transfer_func = 1;
+               update_flags->bits.in_transfer_func_change = 1;
 
        if (u->input_csc_color_matrix)
                update_flags->bits.input_csc_change = 1;
 
-       if (update_flags->bits.in_transfer_func
+       if (update_flags->bits.in_transfer_func_change
                        || update_flags->bits.input_csc_change) {
                type = UPDATE_TYPE_MED;
                elevate_update_type(&overall_type, type);
 
                uint32_t swizzle_change:1;
                uint32_t scaling_change:1;
                uint32_t position_change:1;
-               uint32_t in_transfer_func:1;
+               uint32_t in_transfer_func_change:1;
                uint32_t input_csc_change:1;
 
                /* Full updates */
                uint32_t new_plane:1;
                uint32_t bpp_change:1;
+               uint32_t gamma_change:1;
                uint32_t bandwidth_change:1;
                uint32_t clock_change:1;
                uint32_t stereo_format_change:1;
 
 }
 
 /* Only use LUT for 8 bit formats */
-bool dce_use_lut(const struct dc_plane_state *plane_state)
+bool dce_use_lut(enum surface_pixel_format format)
 {
-       switch (plane_state->format) {
+       switch (format) {
        case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
        case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
                return true;
 
                struct clock_source *clk_src,
                unsigned int tg_inst);
 
-bool dce_use_lut(const struct dc_plane_state *plane_state);
+bool dce_use_lut(enum surface_pixel_format format);
 #endif   /*__DCE_HWSEQ_H__*/
 
        build_prescale_params(&prescale_params, plane_state);
        ipp->funcs->ipp_program_prescale(ipp, &prescale_params);
 
-       if (plane_state->gamma_correction && dce_use_lut(plane_state))
+       if (plane_state->gamma_correction && dce_use_lut(plane_state->format))
                ipp->funcs->ipp_program_input_lut(ipp, plane_state->gamma_correction);
 
        if (tf == NULL) {
        struct dc_plane_state *plane_state = pipe_ctx->plane_state;
        struct xfm_grph_csc_adjustment adjust;
        struct out_csc_color_matrix tbl_entry;
-       struct pipe_ctx *cur_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
        unsigned int i;
 
        memset(&tbl_entry, 0, sizeof(tbl_entry));
                                plane_state->rotation);
 
        /* Moved programming gamma from dc to hwss */
-       if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state) {
+       if (pipe_ctx->plane_state->update_flags.bits.full_update ||
+                       pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
+                       pipe_ctx->plane_state->update_flags.bits.gamma_change)
                dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
+
+       if (pipe_ctx->plane_state->update_flags.bits.full_update)
                dc->hwss.set_output_transfer_func(pipe_ctx, pipe_ctx->stream);
-       }
 
        dm_logger_write(dc->ctx->logger, LOG_SURFACE,
                        "Pipe:%d 0x%x: addr hi:0x%x, "
 
        if (plane_state->in_transfer_func)
                tf = plane_state->in_transfer_func;
 
-       if (plane_state->gamma_correction && dce_use_lut(plane_state))
+       if (plane_state->gamma_correction && dce_use_lut(plane_state->format))
                dpp_base->funcs->dpp_program_input_lut(dpp_base, plane_state->gamma_correction);
 
        if (tf == NULL)
        }
 
        if (pipe_ctx->plane_state != NULL) {
-               struct pipe_ctx *cur_pipe_ctx =
-                               &dc->current_state->res_ctx.pipe_ctx[pipe_ctx->pipe_idx];
-
                if (pipe_ctx->plane_state->update_flags.bits.full_update)
                        dcn10_enable_plane(dc, pipe_ctx, context);
 
                update_dchubp_dpp(dc, pipe_ctx, context);
 
-               if (cur_pipe_ctx->plane_state != pipe_ctx->plane_state)
+               if (pipe_ctx->plane_state->update_flags.bits.full_update ||
+                               pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
+                               pipe_ctx->plane_state->update_flags.bits.gamma_change)
                        dc->hwss.set_input_transfer_func(pipe_ctx, pipe_ctx->plane_state);
 
                /* dcn10_translate_regamma_to_hw_format takes 750us to finish