From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 03/36] drm/omap: add crtc background property
Date: Wed, 30 Nov 2016 13:25:47 +0200 [thread overview]
Message-ID: <12876642.tLkKeZufpa@avalon> (raw)
In-Reply-To: <1480504658-11775-4-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
Thank you for the patch.
On Wednesday 30 Nov 2016 13:17:05 Tomi Valkeinen wrote:
> Add DRM property for crtc background color property. Background
> color is shown on areas where there are no planes.
The background property is useful for the rcar-du driver as well, and I assume
for a bunch of other display engines too. Could you please standardize it ?
And for the usual bikeshedding required in those circumstances, should it be
called background-color or bgcolor instead ?
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/gpu/drm/omapdrm/omap_crtc.c | 60 +++++++++++++++++++++++++++-------
> drivers/gpu/drm/omapdrm/omap_drv.c | 9 ++++++
> drivers/gpu/drm/omapdrm/omap_drv.h | 5 +++-
> 3 files changed, 63 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c
> b/drivers/gpu/drm/omapdrm/omap_crtc.c index ff1570c096f8..c0e30a4cb2a9
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -48,6 +48,8 @@ struct omap_crtc {
>
> struct omap_crtc_state {
> struct drm_crtc_state base;
> +
> + u32 default_color;
> };
>
> /*
> ---------------------------------------------------------------------------
> -- @@ -196,15 +198,7 @@ static void omap_crtc_set_enabled(struct drm_crtc
> *crtc, bool enable) static int omap_crtc_dss_enable(enum omap_channel
> channel)
> {
> struct omap_crtc *omap_crtc = omap_crtcs[channel];
> - struct omap_overlay_manager_info info;
> -
> - memset(&info, 0, sizeof(info));
> - info.default_color = 0x00000000;
> - info.trans_key = 0x00000000;
> - info.trans_key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
> - info.trans_enabled = false;
>
> - dispc_mgr_setup(omap_crtc->channel, &info);
> dispc_mgr_set_timings(omap_crtc->channel,
> &omap_crtc->vm);
> omap_crtc_set_enabled(&omap_crtc->base, true);
> @@ -319,6 +313,20 @@ static void omap_crtc_vblank_irq(struct omap_drm_irq
> *irq, uint32_t irqstatus) wake_up(&omap_crtc->pending_wait);
> }
>
> +static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc)
> +{
> + struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
> + struct omap_overlay_manager_info info;
> + const struct omap_crtc_state *omap_state =
> + to_omap_crtc_state(crtc->state);
> +
> + memset(&info, 0, sizeof(info));
> + info.default_color = omap_state->default_color;
> + info.trans_enabled = false;
> +
> + dispc_mgr_setup(omap_crtc->channel, &info);
> +}
> +
> /*
> ---------------------------------------------------------------------------
> -- * CRTC Functions
> */
> @@ -362,6 +370,8 @@ static void omap_crtc_reset(struct drm_crtc *crtc)
> if (omap_state == NULL)
> return;
>
> + omap_state->default_color = 0;
> +
> crtc->state = &omap_state->base;
> crtc->state->crtc = crtc;
> }
> @@ -462,6 +472,8 @@ static void omap_crtc_atomic_flush(struct drm_crtc
> *crtc, dispc_mgr_set_gamma(omap_crtc->channel, lut, length);
> }
>
> + omap_crtc_write_crtc_properties(crtc);
> +
> if (dispc_mgr_is_enabled(omap_crtc->channel)) {
>
> DBG("%s: GO", omap_crtc->name);
> @@ -491,6 +503,10 @@ static int omap_crtc_atomic_set_property(struct
> drm_crtc *crtc, struct drm_property *property,
> uint64_t val)
> {
> + struct drm_device *dev = crtc->dev;
> + struct omap_drm_private *priv = dev->dev_private;
> + struct omap_crtc_state *omap_state = to_omap_crtc_state(state);
> +
> if (omap_crtc_is_plane_prop(crtc, property)) {
> struct drm_plane_state *plane_state;
> struct drm_plane *plane = crtc->primary;
> @@ -508,7 +524,12 @@ static int omap_crtc_atomic_set_property(struct
> drm_crtc *crtc, property, val);
> }
>
> - return -EINVAL;
> + if (property == priv->background_color_prop)
> + omap_state->default_color = val;
> + else
> + return -EINVAL;
> +
> + return 0;
> }
>
> static int omap_crtc_atomic_get_property(struct drm_crtc *crtc,
> @@ -516,6 +537,10 @@ static int omap_crtc_atomic_get_property(struct
> drm_crtc *crtc, struct drm_property *property,
> uint64_t *val)
> {
> + struct drm_device *dev = crtc->dev;
> + struct omap_drm_private *priv = dev->dev_private;
> + struct omap_crtc_state *omap_state = to_omap_crtc_state(state);
> +
> if (omap_crtc_is_plane_prop(crtc, property)) {
> /*
> * Delegate property get to the primary plane. The
> @@ -527,7 +552,12 @@ static int omap_crtc_atomic_get_property(struct
> drm_crtc *crtc, property, val);
> }
>
> - return -EINVAL;
> + if (property == priv->background_color_prop)
> + *val = omap_state->default_color;
> + else
> + return -EINVAL;
> +
> + return 0;
> }
>
> static const struct drm_crtc_funcs omap_crtc_funcs = {
> @@ -573,6 +603,15 @@ void omap_crtc_pre_uninit(void)
> dss_uninstall_mgr_ops();
> }
>
> +static void omap_crtc_install_properties(struct drm_crtc *crtc)
> +{
> + struct drm_device *dev = crtc->dev;
> + struct drm_mode_object *obj = &crtc->base;
> + struct omap_drm_private *priv = dev->dev_private;
> +
> + drm_object_attach_property(obj, priv->background_color_prop, 0);
> +}
> +
> /* initialize crtc */
> struct drm_crtc *omap_crtc_init(struct drm_device *dev,
> struct drm_plane *plane, enum omap_channel channel, int id)
> @@ -625,6 +664,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
> drm_mode_crtc_set_gamma_size(crtc, gamma_lut_size);
> }
>
> + omap_crtc_install_properties(crtc);
> omap_plane_install_properties(crtc->primary, &crtc->base);
>
> omap_crtcs[channel] = omap_crtc;
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 39c5312b466c..8c58ca7db382
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -293,10 +293,19 @@ static int omap_modeset_init_properties(struct
> drm_device *dev) {
> struct omap_drm_private *priv = dev->dev_private;
>
> + /* plane properties */
> +
> priv->zorder_prop = drm_property_create_range(dev, 0, "zorder", 0, 3);
> if (!priv->zorder_prop)
> return -ENOMEM;
>
> + /* crtc properties */
> +
> + priv->background_color_prop = drm_property_create_range(dev, 0,
> + "background", 0, 0xffffff);
> + if (!priv->background_color_prop)
> + return -ENOMEM;
> +
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h
> b/drivers/gpu/drm/omapdrm/omap_drv.h index 4c51135eb9a6..0d16294e8145
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -97,9 +97,12 @@ struct omap_drm_private {
> struct omap_drm_usergart *usergart;
> bool has_dmm;
>
> - /* properties: */
> + /* plane properties */
> struct drm_property *zorder_prop;
>
> + /* crtc properties */
> + struct drm_property *background_color_prop;
> +
> /* irq handling: */
> struct list_head irq_list; /* list of omap_drm_irq */
> uint32_t vblank_mask; /* irq bits set for userspace vblank */
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-11-30 11:25 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 11:17 [PATCH 00/36] drm/omap: miscallaneous improvements Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 01/36] drm/omap: work-around for errata i886 Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 02/36] drm/omap: subclass drm_crtc_state Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 03/36] drm/omap: add crtc background property Tomi Valkeinen
2016-11-30 11:25 ` Laurent Pinchart [this message]
2016-11-30 12:51 ` Tomi Valkeinen
2016-11-30 13:34 ` Laurent Pinchart
2016-11-30 13:53 ` Ville Syrjälä
2016-11-30 13:56 ` Laurent Pinchart
2016-11-30 14:40 ` Ville Syrjälä
2016-11-30 14:46 ` Laurent Pinchart
2016-11-30 14:50 ` Ville Syrjälä
2016-11-30 13:32 ` Daniel Vetter
2016-12-09 11:03 ` Tomi Valkeinen
2016-12-09 13:41 ` Daniel Vetter
2016-11-30 11:17 ` [PATCH 04/36] drm/omap: remove divider constraint from hsdiv Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 05/36] drm/omap: decrease min width & height Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 06/36] drm/omap: improve DPI clock selection on DRA7xx Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 07/36] drm/omap: Init fbdev emulation only when we have displays Tomi Valkeinen
2016-11-30 13:46 ` Daniel Vetter
2016-12-09 11:13 ` Tomi Valkeinen
2016-12-09 14:09 ` Daniel Vetter
2016-11-30 11:17 ` [PATCH 08/36] drm/omap: Add support for render nodes Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 09/36] drm/omap: fix HDMI sync polarities Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 10/36] drm/omap: add omapdss_of_get_endpoint() helper Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 11/36] drm/omap: add omapdss-base.ko Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 12/36] drm/omap: move dss_initialized to omapdss-base Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 13/36] drm/omap: output: use dev_err instead of DSSERR Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 14/36] drm/omap: display: don't use dsi_get_pixel_size() Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 15/36] drm/omap: move display, dss-of, output to omapdss-base Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 16/36] drm/omap: move dispc related dss-feat funcs to dispc Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 17/36] drm/omap: add dispc_ops Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 18/36] drm/omap: fill dispc_ops Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 19/36] drm/omap: use dispc_ops Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 20/36] drm/omap: remove all EXPORT_SYMBOLs from dispc.c Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 21/36] drm/omap: remove unused dispc_wb_enable & dispc_wb_is_enabled Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 22/36] drm/omap: fix replication logic Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 23/36] drm/omap: dss: Functions to check components in the display/output list Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 24/36] drm/omap: dss: Support for detecting display stack readiness Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 25/36] drm/omap: Use omapdss_stack_is_ready() to check that the display stack is up Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 26/36] drm/omap: fix plane update warning when crtc is disabled Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 27/36] drm/omap: display: Add displays in sorted order to the panel_list Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 28/36] drm/omap: Create fbdev emulation only for the first DRM connector Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 29/36] drm/omap: fix max fb width Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 30/36] drm/omap: poll only connectors where the connect/disconnect can be checked Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 31/36] drm/omap: Support for HDMI hot plug detection Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 32/36] drm/omap: displays: connector-hdmi: Support for " Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 33/36] drm/omap: displays: encoder-tpd12s015: " Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 34/36] drm/omap: displays: panel-dpi: Support for handling backlight devices Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 35/36] drm/omap: dispc: improve debug print of display flags Tomi Valkeinen
2016-11-30 11:17 ` [PATCH 36/36] drm/omap: fix display SYNC/DE flags Tomi Valkeinen
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=12876642.tLkKeZufpa@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=tomi.valkeinen@ti.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.