All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lankhorst, Maarten" <maarten.lankhorst@intel.com>
To: "Shankar, Uma" <uma.shankar@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "Syrjala, Ville" <ville.syrjala@intel.com>,
	"sam@ravnborg.org" <sam@ravnborg.org>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	"dcastagna@chromium.org" <dcastagna@chromium.org>
Subject: Re: [v3 6/7] drm: Add Client Cap for advance gamma mode
Date: Mon, 15 Apr 2019 10:57:52 +0000	[thread overview]
Message-ID: <1555325871.3259.1.camel@intel.com> (raw)
In-Reply-To: <1555064463-18479-7-git-send-email-uma.shankar@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 4411 bytes --]

fre 2019-04-12 klockan 15:51 +0530 skrev Uma Shankar:
> Introduced a client cap for advance cap mode
> capability. Userspace should set this to get
> to be able to use the new gamma_mode property.
> 
> If this is not set, driver will work in legacy
> mode.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>

Nack, this doesn't seem like a sensible idea. We already guard it
behind the gamma mode property. Userspace shouldn't set the gamma mode
to a value it doesn't understand.

~Maarten

>  drivers/gpu/drm/drm_atomic_uapi.c | 3 +++
>  drivers/gpu/drm/drm_ioctl.c       | 5 +++++
>  include/drm/drm_atomic.h          | 1 +
>  include/drm/drm_crtc.h            | 7 +++++++
>  include/drm/drm_file.h            | 8 ++++++++
>  include/uapi/drm/drm.h            | 2 ++
>  6 files changed, 26 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c
> b/drivers/gpu/drm/drm_atomic_uapi.c
> index d85e0c9..590c87a 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -974,6 +974,8 @@ int drm_atomic_set_property(struct
> drm_atomic_state *state,
>  			break;
>  		}
>  
> +		crtc_state->advance_gamma_mode_active =
> +					state-
> >advance_gamma_mode_active;
>  		ret = drm_atomic_crtc_set_property(crtc,
>  				crtc_state, prop, prop_value);
>  		break;
> @@ -1297,6 +1299,7 @@ int drm_mode_atomic_ioctl(struct drm_device
> *dev,
>  	drm_modeset_acquire_init(&ctx,
> DRM_MODESET_ACQUIRE_INTERRUPTIBLE);
>  	state->acquire_ctx = &ctx;
>  	state->allow_modeset = !!(arg->flags &
> DRM_MODE_ATOMIC_ALLOW_MODESET);
> +	state->advance_gamma_mode_active = file_priv-
> >advance_gamma_mode_active;
>  
>  retry:
>  	copied_objs = 0;
> diff --git a/drivers/gpu/drm/drm_ioctl.c
> b/drivers/gpu/drm/drm_ioctl.c
> index d337f16..e593a4c 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -348,6 +348,11 @@ static int drm_getcap(struct drm_device *dev,
> void *data, struct drm_file *file_
>  			return -EINVAL;
>  		file_priv->writeback_connectors = req->value;
>  		break;
> +	case DRM_CLIENT_CAP_ADVANCE_GAMMA_MODES:
> +		if (req->value > 1)
> +			return -EINVAL;
> +		file_priv->advance_gamma_mode_active = req->value;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index 824a5ed..02c1a68 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -338,6 +338,7 @@ struct drm_atomic_state {
>  	 * states.
>  	 */
>  	bool duplicated : 1;
> +	bool advance_gamma_mode_active : 1;
>  	struct __drm_planes_state *planes;
>  	struct __drm_crtcs_state *crtcs;
>  	int num_connector;
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index f789359..f11dc25 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -170,6 +170,11 @@ struct drm_crtc_state {
>  	bool color_mgmt_changed : 1;
>  
>  	/**
> +	 * This is to indicate advance gamma mode support
> +	 */
> +	bool advance_gamma_mode_active : 1;
> +
> +	/**
>  	 * @no_vblank:
>  	 *
>  	 * Reflects the ability of a CRTC to send VBLANK events.
> This state
> @@ -952,6 +957,8 @@ struct drm_crtc {
>  	 */
>  	bool enabled;
>  
> +	bool advance_gamma_mode_active : 1;
> +
>  	/**
>  	 * @mode:
>  	 *
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 6710b61..b5aa24e 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -201,6 +201,14 @@ struct drm_file {
>  	bool writeback_connectors;
>  
>  	/**
> +	 * This is to enable advance gamma modes using
> +	 * gamma_mode property
> +	 *
> +	 * True if client understands advance gamma
> +	 */
> +	bool advance_gamma_mode_active : 1;
> +
> +	/**
>  	 * @is_master:
>  	 *
>  	 * This client is the creator of @master. Protected by
> struct
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 236b01a..abef966 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -696,6 +696,8 @@ struct drm_get_cap {
>   */
>  #define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS	5
>  
> +#define DRM_CLIENT_CAP_ADVANCE_GAMMA_MODES	6
> +
>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>  struct drm_set_client_cap {
>  	__u64 capability;

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3282 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-15 10:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 10:20 [v3 0/7] Add Multi Segment Gamma Support Uma Shankar
2019-04-12 10:20 ` [v3 1/7] drm: Add gamma mode property Uma Shankar
2019-04-16  7:28   ` Daniel Vetter
2019-04-12 10:20 ` [v3 2/7] drm/i915: Define color lut range structure Uma Shankar
2019-04-12 10:20 ` [v3 3/7] drm/i915/icl: Add register definitions for Multi Segmented gamma Uma Shankar
2019-04-12 10:21 ` [v3 4/7] drm/i915/icl: Add support for multi segmented gamma mode Uma Shankar
2019-04-12 10:21 ` [v3 5/7] drm/i915: Attach gamma mode property Uma Shankar
2019-04-12 10:21 ` [v3 6/7] drm: Add Client Cap for advance gamma mode Uma Shankar
2019-04-15 10:57   ` Lankhorst, Maarten [this message]
2019-04-15 12:43     ` [Intel-gfx] " Ville Syrjälä
2019-04-16  8:54       ` Lankhorst, Maarten
2019-04-15 13:56     ` Sharma, Shashank
2019-04-15 14:12       ` Lankhorst, Maarten
2019-04-15 14:29         ` Sharma, Shashank
2019-04-15 19:20         ` Daniel Vetter
2019-04-16 15:06           ` Ville Syrjälä
2019-04-12 10:21 ` [v3 7/7] drm/i915: Enable " Uma Shankar
2019-04-12 10:39 ` ✗ Fi.CI.CHECKPATCH: warning for Add Multi Segment Gamma Support (rev3) Patchwork
2019-04-12 12:50 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-04-17  7:28 ` [v3 0/7] Add Multi Segment Gamma Support Daniel Vetter
2019-04-17 11:57   ` Ville Syrjälä
2019-04-18  7:13     ` Daniel Vetter
2019-04-18 13:11       ` Ville Syrjälä
2019-04-23  6:52         ` Daniel Vetter

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=1555325871.3259.1.camel@intel.com \
    --to=maarten.lankhorst@intel.com \
    --cc=dcastagna@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sam@ravnborg.org \
    --cc=seanpaul@chromium.org \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@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.