From: "Jindal, Sonika" <sonika.jindal@intel.com>
To: Kausal Malladi <Kausal.Malladi@intel.com>,
matthew.d.roper@intel.com, jesse.barnes@intel.com,
damien.lespiau@intel.com, durgadoss.r@intel.com,
vijay.a.purushothaman@intel.com, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Cc: avinash.reddy.palleti@intel.com, annie.j.matherson@intel.com,
indranil.mukherjee@intel.com, dhanya.p.r@intel.com,
sunil.kamath@intel.com, daniel.vetter@intel.com,
shashank.sharma@intel.com
Subject: Re: [PATCH 1/7] drm/i915: Initialize Color Manager
Date: Tue, 02 Jun 2015 16:36:17 +0530 [thread overview]
Message-ID: <556D8E29.6040405@intel.com> (raw)
In-Reply-To: <1433188369-16930-2-git-send-email-Kausal.Malladi@intel.com>
On 6/2/2015 1:22 AM, Kausal Malladi wrote:
> From: Kausal Malladi <Kausal.Malladi@intel.com>
>
> Color Manager is an extension in i915 driver to handle color correction
> and enhancements across various Intel platforms.
>
> This patch initializes color manager framework by :
> 1. Adding two new files, intel_color_manager(.c/.h)
> 2. Introducing new pointers in DRM mode_config structure to
> carry CSC and Gamma color correction properties.
> 3. Creating these DRM properties in Color Manager initialization
> sequence.
>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> Signed-off-by: Kausal Malladi <Kausal.Malladi@intel.com>
> ---
> drivers/gpu/drm/i915/Makefile | 3 ++
> drivers/gpu/drm/i915/intel_color_manager.c | 49 ++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_color_manager.h | 32 ++++++++++++++++++
> drivers/gpu/drm/i915/intel_display.c | 5 +++
> include/drm/drm_crtc.h | 4 +++
> 5 files changed, 93 insertions(+)
> create mode 100644 drivers/gpu/drm/i915/intel_color_manager.c
> create mode 100644 drivers/gpu/drm/i915/intel_color_manager.h
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index b7ddf48..c62d048 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -89,6 +89,9 @@ i915-y += i915_vgpu.o
> # legacy horrors
> i915-y += i915_dma.o
>
> +# Color Management
> +i915-y += intel_color_manager.o
> +
> obj-$(CONFIG_DRM_I915) += i915.o
>
> CFLAGS_i915_trace_points.o := -I$(src)
> diff --git a/drivers/gpu/drm/i915/intel_color_manager.c b/drivers/gpu/drm/i915/intel_color_manager.c
> new file mode 100644
> index 0000000..c83a212
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_color_manager.c
> @@ -0,0 +1,49 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + * Shashank Sharma <shashank.sharma@intel.com>
> + * Kausal Malladi <Kausal.Malladi@intel.com>
> + */
> +
> +#include "intel_color_manager.h"
> +
> +int intel_color_manager_init(struct drm_device *dev)
> +{
> + struct drm_mode_config *config = &dev->mode_config;
> +
> + /* Create Gamma and CSC properties */
> + config->gamma_property = drm_property_create(dev,
> + DRM_MODE_PROP_BLOB, "gamma_property", 0);
> + if (!config->gamma_property)
> + DRM_ERROR("Gamma property creation failed\n");
> +
> + DRM_DEBUG_DRIVER("Created Gamma property\n");
> +
> + config->csc_property = drm_property_create(dev,
> + DRM_MODE_PROP_BLOB, "csc_property", 0);
> + if (!config->csc_property)
> + DRM_ERROR("CSC property creation failed\n");
> +
> + DRM_DEBUG_DRIVER("Created CSC property\n");
> + return 0;
> +}
> diff --git a/drivers/gpu/drm/i915/intel_color_manager.h b/drivers/gpu/drm/i915/intel_color_manager.h
> new file mode 100644
> index 0000000..3cff09d
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_color_manager.h
> @@ -0,0 +1,32 @@
> +/*
> + * Copyright © 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + * Shashank Sharma <shashank.sharma@intel.com>
> + * Kausal Malladi <Kausal.Malladi@intel.com>
> + */
> +
> +#include <drm/drmP.h>
> +#include <drm/drm_crtc_helper.h>
> +
> +/* Generic Function prototypes */
> +int intel_color_manager_init(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 067b1de..93eed31 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -44,6 +44,7 @@
> #include <drm/drm_plane_helper.h>
> #include <drm/drm_rect.h>
> #include <linux/dma_remapping.h>
> +#include "intel_color_manager.h"
>
> /* Primary plane formats for gen <= 3 */
> static const uint32_t i8xx_primary_formats[] = {
> @@ -14670,6 +14671,10 @@ void intel_modeset_init(struct drm_device *dev)
>
> intel_init_pm(dev);
>
> + ret = intel_color_manager_init(dev);
This call never fails, you might want to add returning of errors
Also, it is better to move this initialization after the num_pipes
check, so that we are not initializing the color manager when modeset fails.
> + if (ret)
> + DRM_ERROR("Color Manager initialization failed\n");
> +
> if (INTEL_INFO(dev)->num_pipes == 0)
> return;
>
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 3b4d8a4..4085339 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1187,6 +1187,10 @@ struct drm_mode_config {
>
> /* cursor size */
> uint32_t cursor_width, cursor_height;
> +
> + /* Color Management Properties */
> + struct drm_property *gamma_property;
> + struct drm_property *csc_property;
This can be moved near the property section in the same struct.
> };
>
> /**
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next parent reply other threads:[~2015-06-02 11:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1433188369-16930-1-git-send-email-Kausal.Malladi@intel.com>
[not found] ` <1433188369-16930-2-git-send-email-Kausal.Malladi@intel.com>
2015-06-02 11:06 ` Jindal, Sonika [this message]
[not found] ` <1433188369-16930-4-git-send-email-Kausal.Malladi@intel.com>
2015-06-02 11:19 ` [PATCH 3/7] drm/i915: Add Set property interface for CRTC Jindal, Sonika
[not found] ` <1433188369-16930-5-git-send-email-Kausal.Malladi@intel.com>
2015-06-02 11:25 ` [PATCH 4/7] drm: Add Gamma correction structure Jindal, Sonika
2015-06-02 11:35 ` [Intel-gfx] " Daniel Stone
[not found] ` <1433188369-16930-6-git-send-email-Kausal.Malladi@intel.com>
2015-06-02 11:38 ` [PATCH 5/7] drm/i915: Add pipe level Gamma correction for CHV/BSW Jindal, Sonika
2015-06-02 11:53 ` Daniel Stone
2015-06-03 13:51 ` Sharma, Shashank
2015-06-03 13:26 ` Sharma, Shashank
2015-06-02 12:00 ` [PATCH 0/7] Color Manager Implementation Damien Lespiau
2015-06-02 12:03 ` Sharma, Shashank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=556D8E29.6040405@intel.com \
--to=sonika.jindal@intel.com \
--cc=Kausal.Malladi@intel.com \
--cc=annie.j.matherson@intel.com \
--cc=avinash.reddy.palleti@intel.com \
--cc=damien.lespiau@intel.com \
--cc=daniel.vetter@intel.com \
--cc=dhanya.p.r@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=durgadoss.r@intel.com \
--cc=indranil.mukherjee@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jesse.barnes@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=shashank.sharma@intel.com \
--cc=sunil.kamath@intel.com \
--cc=vijay.a.purushothaman@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.