public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: <sunpeng.li-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-amdgpu 2/5] Hook up CRTC color management functions
Date: Mon, 26 Mar 2018 16:00:15 -0400	[thread overview]
Message-ID: <1522094418-9102-3-git-send-email-sunpeng.li@amd.com> (raw)
In-Reply-To: <1522094418-9102-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>

From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>

The functions insert into the output resource creation, and property
change functions. CRTC destroy is also hooked-up for proper cleanup of
the CRTC property list.

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
---
 src/drmmode_display.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 23f9ad3..1966fd2 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1336,7 +1336,7 @@ static xf86CrtcFuncsRec drmmode_crtc_funcs = {
 	.shadow_create = drmmode_crtc_shadow_create,
 	.shadow_allocate = drmmode_crtc_shadow_allocate,
 	.shadow_destroy = drmmode_crtc_shadow_destroy,
-	.destroy = NULL,	/* XXX */
+	.destroy = drmmode_crtc_destroy,
 	.set_scanout_pixmap = drmmode_set_scanout_pixmap,
 };
 
@@ -1933,6 +1933,9 @@ static void drmmode_output_create_resources(xf86OutputPtr output)
 			}
 		}
 	}
+
+	if (output->crtc)
+		drmmode_crtc_create_resources(output->crtc, output);
 }
 
 /**
@@ -2009,6 +2012,20 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property,
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn);
 	int i;
 
+	if (output->crtc) {
+		int ret;
+		ret = drmmode_crtc_set_property(output->crtc, property, value);
+		if (ret == 0)
+			return TRUE;
+		if (ret < 0) {
+			xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+				   "Set CRTC mode property failed with %d\n",
+				   ret);
+			return FALSE;
+		}
+		/* Else, continue */
+	}
+
 	for (i = 0; i < drmmode_output->num_props; i++) {
 		drmmode_prop_ptr p = &drmmode_output->props[i];
 
-- 
2.7.4

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

  parent reply	other threads:[~2018-03-26 20:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 20:00 [PATCH xf86-video-amdgpu 0/5] Implementing non-legacy color management sunpeng.li-5C7GfCeVMHo
     [not found] ` <1522094418-9102-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-03-26 20:00   ` [PATCH xf86-video-amdgpu 1/5] Add functions for changing CRTC color management properties sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1522094418-9102-2-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-04-09 15:03       ` Michel Dänzer
     [not found]         ` <0f5652b1-82af-23a2-969e-0e47844fef28-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 18:02           ` Leo Li
     [not found]             ` <25c493fd-dfa3-1549-6d7c-30790d48acae-5C7GfCeVMHo@public.gmane.org>
2018-04-11  8:39               ` Michel Dänzer
     [not found]                 ` <90b36645-a08a-b36d-2e76-64ad9709b1a8-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-11 21:26                   ` Leo Li
2018-03-26 20:00   ` sunpeng.li-5C7GfCeVMHo [this message]
     [not found]     ` <1522094418-9102-3-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-04-09 15:03       ` [PATCH xf86-video-amdgpu 2/5] Hook up CRTC color management functions Michel Dänzer
     [not found]         ` <01457540-fbc7-b608-4aee-5df18f7a7dde-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 18:02           ` Leo Li
     [not found]             ` <8994afe3-812f-432f-27ef-ab5db3513d15-5C7GfCeVMHo@public.gmane.org>
2018-04-11  8:48               ` Michel Dänzer
     [not found]                 ` <ce29def3-b0f5-3c4a-cd3f-ca3c61770f81-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-11 21:26                   ` Leo Li
2018-03-26 20:00   ` [PATCH xf86-video-amdgpu 3/5] Keep CRTC properties consistent sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1522094418-9102-4-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-04-09 15:03       ` Michel Dänzer
     [not found]         ` <2fbbae9b-c874-7187-9b69-0a929dcaf5cf-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 18:02           ` Leo Li
     [not found]             ` <0b884ad3-c193-9eab-ca93-ff0ca0672f1e-5C7GfCeVMHo@public.gmane.org>
2018-04-11  8:39               ` Michel Dänzer
     [not found]                 ` <4cd3224e-fd14-e66f-56bf-b983b8f74bc8-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-11 21:26                   ` Leo Li
     [not found]                     ` <78b780f2-d075-9496-e62a-8f6de989b992-5C7GfCeVMHo@public.gmane.org>
2018-04-12 10:30                       ` Michel Dänzer
     [not found]                         ` <cc580a31-0679-5492-afff-2ff683ca975d-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-12 16:48                           ` Leo Li
     [not found]                             ` <f915a0db-4756-91de-e9dd-336da66060e6-5C7GfCeVMHo@public.gmane.org>
2018-04-13  9:12                               ` Michel Dänzer
2018-03-26 20:00   ` [PATCH xf86-video-amdgpu 4/5] Enable configure & change helper to handle enums sunpeng.li-5C7GfCeVMHo
     [not found]     ` <1522094418-9102-5-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org>
2018-04-09 15:03       ` Michel Dänzer
2018-03-26 20:00   ` [PATCH xf86-video-amdgpu 5/5] Modify output_create_resources to use configure & change helper sunpeng.li-5C7GfCeVMHo
2018-04-09 14:10   ` [PATCH xf86-video-amdgpu 0/5] Implementing non-legacy color management Michel Dänzer
     [not found]     ` <53e9ea09-8b20-70fd-b7ef-c0219d46bdcc-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 18:02       ` Leo Li

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=1522094418-9102-3-git-send-email-sunpeng.li@amd.com \
    --to=sunpeng.li-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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