for (i = 0; i < new_surface_count; i++) {
updates[i].surface = new_surfaces[i];
- updates[i].gamma = (struct dc_gamma *)new_surfaces[i]->gamma_correction;
-
+ updates[i].gamma =
+ (struct dc_gamma *)new_surfaces[i]->gamma_correction;
flip_addr[i].address = new_surfaces[i]->address;
flip_addr[i].flip_immediate = new_surfaces[i]->flip_immediate;
plane_info[i].color_space = new_surfaces[i]->color_space;
pipe_ctx->scl_data.recout.width -= 2;
}
}
+
+ if (updates[i].gamma) {
+ if (surface->public.gamma_correction != NULL)
+ dc_gamma_release(surface->public.
+ gamma_correction);
+
+ dc_gamma_retain(updates[i].gamma);
+ surface->public.gamma_correction =
+ updates[i].gamma;
+ }
}
}
static void destruct(struct surface *surface)
{
-
+ if (surface->protected.public.gamma_correction != NULL)
+ dc_gamma_release(surface->protected.public.gamma_correction);
}
/*******************************************************************************
void dc_surface_retain(const struct dc_surface *dc_surface);
void dc_surface_release(const struct dc_surface *dc_surface);
+void dc_gamma_retain(const struct dc_gamma *dc_gamma);
void dc_gamma_release(const struct dc_gamma *dc_gamma);
struct dc_gamma *dc_create_gamma(void);