public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Uma Shankar <uma.shankar@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: dcastagna@chromium.org, sam@ravnborg.org, seanpaul@chromium.org,
	ville.syrjala@intel.com, maarten.lankhorst@intel.com
Subject: [v3 6/7] drm: Add Client Cap for advance gamma mode
Date: Fri, 12 Apr 2019 15:51:02 +0530	[thread overview]
Message-ID: <1555064463-18479-7-git-send-email-uma.shankar@intel.com> (raw)
In-Reply-To: <1555064463-18479-1-git-send-email-uma.shankar@intel.com>

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>
---
 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;
-- 
1.9.1

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

  parent reply	other threads:[~2019-04-12 10:21 UTC|newest]

Thread overview: 22+ 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 ` Uma Shankar [this message]
2019-04-15 10:57   ` [v3 6/7] drm: Add Client Cap for advance gamma mode Lankhorst, Maarten
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-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=1555064463-18479-7-git-send-email-uma.shankar@intel.com \
    --to=uma.shankar@intel.com \
    --cc=dcastagna@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@intel.com \
    --cc=sam@ravnborg.org \
    --cc=seanpaul@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox