AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Kleiner <mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: [PATCH 1/4] Define per x-screen individual drmmode_crtc_funcs
Date: Mon, 22 Jan 2018 03:14:34 +0100	[thread overview]
Message-ID: <20180122021437.9361-2-mario.kleiner.de@gmail.com> (raw)
In-Reply-To: <20180122021437.9361-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

This allows to en-/disable some functions depending
on individual screen settings.

Prep work for more efficient depth 30 support.

Suggested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
 src/drmmode_display.c | 14 ++++++++++----
 src/radeon.h          |  2 ++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f55677f..b1c874c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1395,8 +1395,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_res
 	xf86CrtcPtr crtc;
 	drmmode_crtc_private_ptr drmmode_crtc;
 	RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+	RADEONInfoPtr info = RADEONPTR(pScrn);
 
-	crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs);
+	crtc = xf86CrtcCreate(pScrn, &info->drmmode_crtc_funcs);
 	if (crtc == NULL)
 		return 0;
 
@@ -2531,11 +2532,16 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		       "%d crtcs needed for screen.\n", crtcs_needed);
 
+	/* Need per-screen drmmode_crtc_funcs, based on our global template,
+	 * so we can disable some functions, depending on screen settings.
+	 */
+	info->drmmode_crtc_funcs = drmmode_crtc_funcs;
+
 	if (info->r600_shadow_fb) {
 		/* Rotation requires hardware acceleration */
-		drmmode_crtc_funcs.shadow_allocate = NULL;
-		drmmode_crtc_funcs.shadow_create = NULL;
-		drmmode_crtc_funcs.shadow_destroy = NULL;
+		info->drmmode_crtc_funcs.shadow_allocate = NULL;
+		info->drmmode_crtc_funcs.shadow_create = NULL;
+		info->drmmode_crtc_funcs.shadow_destroy = NULL;
 	}
 
 	drmmode->count_crtcs = mode_res->count_crtcs;
diff --git a/src/radeon.h b/src/radeon.h
index 9658e02..5b71736 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -635,6 +635,8 @@ typedef struct {
 	SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
     } glamor;
 #endif /* USE_GLAMOR */
+
+    xf86CrtcFuncsRec drmmode_crtc_funcs;
 } RADEONInfoRec, *RADEONInfoPtr;
 
 /* radeon_accel.c */
-- 
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-01-22  2:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  2:14 Depth 30 enablement for ati-ddx + exa. Rev 3 Mario Kleiner
     [not found] ` <20180122021437.9361-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-22  2:14   ` Mario Kleiner [this message]
2018-01-22  2:14   ` [PATCH 2/4] Skip xf86HandleColormaps() at color depth 30. (v2) Mario Kleiner
2018-01-22  2:14   ` [PATCH 3/4] exa: Accelerate ARGB2101010 pictures Mario Kleiner
2018-01-22  2:14   ` [PATCH 4/4] Support exa screen color depth 30 on Linux 3.16 and later. (v2) Mario Kleiner
2018-01-22 18:01   ` Depth 30 enablement for ati-ddx + exa. Rev 3 Michel Dänzer
     [not found]     ` <04923fbb-dffb-b849-2f59-16e1f993a728-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-01-24 11:35       ` Michel Dänzer
2018-01-24 17:35       ` Mario Kleiner
     [not found]         ` <046a48e6-ef6d-11b4-99ec-8a8f668df5e6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-25 16:06           ` Michel Dänzer
     [not found]             ` <24d16c05-9d78-b5fd-4f0c-4e64577be1c4-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-01-26 21:42               ` Mario Kleiner
     [not found]                 ` <3e8f6391-8e2f-591e-4341-ead830f72def-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-29 11:50                   ` Michel Dänzer
2018-03-04  7:25       ` [ANNOUNCE] xf86-video-amdgpu 18.0.0 Mario Kleiner
     [not found]         ` <bca9b6ef-c675-95ba-fe02-4e5821902066-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-05  9:55           ` Michel Dänzer

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=20180122021437.9361-2-mario.kleiner.de@gmail.com \
    --to=mario.kleiner.de-re5jqeeqqe8avxtiumwx3w@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