mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 06:08:05 +02:00
backend-drm: add curve_step to struct drm_colorop_3x1d_lut_blob
No behavior change, this should be helpful in the next commits. Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
parent
e060a434a5
commit
371c3921fa
4 changed files with 27 additions and 6 deletions
|
|
@ -57,17 +57,20 @@ drm_colorop_3x1d_lut_blob_destroy_handler(struct wl_listener *l, void *data)
|
|||
*
|
||||
* \param device The DRM device in which we want to look for the blob.
|
||||
* \param xform The xform from which the LUT comes from.
|
||||
* \param curve_step What curve step from the xform originated the 3x1D LUT.
|
||||
* \param lut_len How many taps each of the 1D LUT has.
|
||||
*/
|
||||
struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_search(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len)
|
||||
{
|
||||
struct drm_colorop_3x1d_lut_blob *lut;
|
||||
|
||||
wl_list_for_each(lut, &device->drm_colorop_3x1d_lut_blob_list, link)
|
||||
if (lut->xform == xform && lut->lut_len == lut_len)
|
||||
if (lut->xform == xform && lut->curve_step == curve_step &&
|
||||
lut->lut_len == lut_len)
|
||||
return lut;
|
||||
|
||||
return NULL;
|
||||
|
|
@ -84,6 +87,7 @@ drm_colorop_3x1d_lut_blob_search(struct drm_device *device,
|
|||
* \param device The DRM device in which this colorop blob is stored.
|
||||
* \param xform The xform from which the LUT comes from. This object matches its
|
||||
* lifetime.
|
||||
* \param curve_step What xform curve step originated the 3x1D LUT.
|
||||
* \param lut_len The number of taps for each of the 1D LUT.
|
||||
* \param blob_id The KMS blob id (associated to the DRM device).
|
||||
* \return The 3x1D LUT colorop blob.
|
||||
|
|
@ -91,6 +95,7 @@ drm_colorop_3x1d_lut_blob_search(struct drm_device *device,
|
|||
struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_create(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len, uint32_t blob_id)
|
||||
{
|
||||
struct drm_colorop_3x1d_lut_blob *lut;
|
||||
|
|
@ -98,9 +103,10 @@ drm_colorop_3x1d_lut_blob_create(struct drm_device *device,
|
|||
lut = xzalloc(sizeof(*lut));
|
||||
|
||||
lut->device = device;
|
||||
lut->blob_id = blob_id;
|
||||
lut->xform = xform;
|
||||
lut->curve_step = curve_step;
|
||||
lut->lut_len = lut_len;
|
||||
lut->blob_id = blob_id;
|
||||
|
||||
wl_list_insert(&device->drm_colorop_3x1d_lut_blob_list, &lut->link);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,11 +57,13 @@ struct drm_color_pipeline {
|
|||
struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_create(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len, uint32_t blob_id);
|
||||
|
||||
struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_search(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len);
|
||||
|
||||
void
|
||||
|
|
@ -76,6 +78,7 @@ drm_plane_release_color_pipelines(struct drm_plane *plane);
|
|||
static inline struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_create(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len, uint32_t blob_id)
|
||||
{
|
||||
return NULL;
|
||||
|
|
@ -84,6 +87,7 @@ drm_colorop_3x1d_lut_blob_create(struct drm_device *device,
|
|||
static inline struct drm_colorop_3x1d_lut_blob *
|
||||
drm_colorop_3x1d_lut_blob_search(struct drm_device *device,
|
||||
struct weston_color_transform *xform,
|
||||
enum weston_color_curve_step curve_step,
|
||||
uint32_t lut_len)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -406,6 +406,9 @@ struct drm_colorop_3x1d_lut_blob {
|
|||
struct weston_color_transform *xform;
|
||||
struct wl_listener destroy_listener;
|
||||
|
||||
/* Which curve of the xform the 3x1D LUT was generated from. */
|
||||
enum weston_color_curve_step curve_step;
|
||||
|
||||
uint32_t lut_len;
|
||||
|
||||
uint32_t blob_id;
|
||||
|
|
|
|||
|
|
@ -2283,6 +2283,7 @@ drm_output_pick_blend_to_output(struct drm_output *output)
|
|||
struct drm_backend *b = device->backend;
|
||||
struct drm_colorop_3x1d_lut_blob *colorop_lut;
|
||||
struct weston_color_transform *xform;
|
||||
enum weston_color_curve_step curve_step;
|
||||
struct drm_color_lut *drm_lut;
|
||||
size_t lut_len;
|
||||
uint32_t gamma_lut_blob_id;
|
||||
|
|
@ -2304,10 +2305,17 @@ drm_output_pick_blend_to_output(struct drm_output *output)
|
|||
}
|
||||
|
||||
/**
|
||||
* First let's check if the xform has already been cached. If that's the
|
||||
* For now we expect blend-to-output to be composed of pre-curve only,
|
||||
* so lut_3x1d_from_blend_to_output() will return a LUT it creates from
|
||||
* the xform pre-curve.
|
||||
*/
|
||||
curve_step = WESTON_COLOR_CURVE_STEP_PRE;
|
||||
|
||||
/**
|
||||
* First let's check if the LUT has already been cached. If that's the
|
||||
* case, we make use of it.
|
||||
*/
|
||||
colorop_lut = drm_colorop_3x1d_lut_blob_search(device, xform, lut_len);
|
||||
colorop_lut = drm_colorop_3x1d_lut_blob_search(device, xform, curve_step, lut_len);
|
||||
if (colorop_lut) {
|
||||
output->blend_to_output_xform = colorop_lut;
|
||||
return 0;
|
||||
|
|
@ -2337,8 +2345,8 @@ drm_output_pick_blend_to_output(struct drm_output *output)
|
|||
}
|
||||
|
||||
output->blend_to_output_xform =
|
||||
drm_colorop_3x1d_lut_blob_create(device, xform, lut_len,
|
||||
gamma_lut_blob_id);
|
||||
drm_colorop_3x1d_lut_blob_create(device, xform, curve_step,
|
||||
lut_len, gamma_lut_blob_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue