All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code
@ 2018-06-27 16:39 Michel Dänzer
       [not found] ` <20180627163941.18737-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Michel Dänzer @ 2018-06-27 16:39 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

This has always been disabled, no need to keep it.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/drmmode_display.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 1563417a7..5fe49b607 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2459,15 +2459,6 @@ static const xf86OutputFuncsRec drmmode_output_funcs = {
 	.create_resources = drmmode_output_create_resources,
 	.set_property = drmmode_output_set_property,
 	.get_property = drmmode_output_get_property,
-#if 0
-
-	.save = drmmode_crt_save,
-	.restore = drmmode_crt_restore,
-	.mode_fixup = drmmode_crt_mode_fixup,
-	.prepare = drmmode_output_prepare,
-	.mode_set = drmmode_crt_mode_set,
-	.commit = drmmode_output_commit,
-#endif
 	.detect = drmmode_output_detect,
 	.mode_valid = drmmode_output_mode_valid,
 
@@ -3470,9 +3461,6 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 		    !xf86HandleColormaps(pScreen, 256, 10,
 					 NULL, NULL,
 					 CMAP_PALETTED_TRUECOLOR
-#if 0				/* This option messes up text mode! (eich@suse.de) */
-					 | CMAP_LOAD_EVEN_IF_OFFSCREEN
-#endif
 					 | CMAP_RELOAD_ON_MODE_SWITCH))
 			return FALSE;
 	}
-- 
2.18.0

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap
       [not found] ` <20180627163941.18737-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-06-27 16:39   ` Michel Dänzer
       [not found]     ` <20180627163941.18737-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-06-27 18:29   ` [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code Abramov, Slava
  1 sibling, 1 reply; 6+ messages in thread
From: Michel Dänzer @ 2018-06-27 16:39 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

Instead of from drmmode_set_mode_major. There's no need to re-set the
gamma LUT on every modeset, the kernel should preserve it.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/drmmode_display.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 5fe49b607..9364a885a 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1353,12 +1353,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		else
 			drmmode_crtc->scanout_id = 0;
 
-		/* gamma is disabled in kernel driver for deep color */
-		if (pScrn->depth != 30)
-			drmmode_crtc_gamma_do_set(
-				crtc, crtc->gamma_red, crtc->gamma_green,
-				crtc->gamma_blue, crtc->gamma_size);
-
 		if (drmmode_crtc->prime_scanout_pixmap) {
 			drmmode_crtc_prime_scanout_update(crtc, mode, scanout_id,
 							  &fb, &x, &y);
@@ -3450,6 +3444,7 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
 Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 {
 	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+	int i;
 
 	if (xf86_config->num_crtc) {
 		xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
@@ -3457,13 +3452,23 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 		if (!miCreateDefColormap(pScreen))
 			return FALSE;
 		/* All radeons support 10 bit CLUTs. They get bypassed at depth 30. */
-		if (pScrn->depth != 30 &&
-		    !xf86HandleColormaps(pScreen, 256, 10,
-					 NULL, NULL,
-					 CMAP_PALETTED_TRUECOLOR
-					 | CMAP_RELOAD_ON_MODE_SWITCH))
-			return FALSE;
+		if (pScrn->depth != 30) {
+			if (!xf86HandleColormaps(pScreen, 256, 10, NULL, NULL,
+						 CMAP_PALETTED_TRUECOLOR
+						 | CMAP_RELOAD_ON_MODE_SWITCH))
+				return FALSE;
+
+			for (i = 0; i < xf86_config->num_crtc; i++) {
+				xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+				drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red,
+							  crtc->gamma_green,
+							  crtc->gamma_blue,
+							  crtc->gamma_size);
+			}
+		}
 	}
+
 	return TRUE;
 }
 
-- 
2.18.0

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code
       [not found] ` <20180627163941.18737-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-06-27 16:39   ` [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap Michel Dänzer
@ 2018-06-27 18:29   ` Abramov, Slava
       [not found]     ` <CY4PR12MB13040D289B98AF5798E9C4EEFE480-rpdhrqHFk05fmUFYn07qFQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Abramov, Slava @ 2018-06-27 18:29 UTC (permalink / raw)
  To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


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

I wonder how '#if 0' made its way upstream, but besides this


Reviewed-by: Slava Abramov <slava.abramov-5C7GfCeVMHo@public.gmane.org>

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Sent: Wednesday, June 27, 2018 12:39:40 PM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code

From: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>

This has always been disabled, no need to keep it.

Signed-off-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
---
 src/drmmode_display.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 1563417a7..5fe49b607 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2459,15 +2459,6 @@ static const xf86OutputFuncsRec drmmode_output_funcs = {
         .create_resources = drmmode_output_create_resources,
         .set_property = drmmode_output_set_property,
         .get_property = drmmode_output_get_property,
-#if 0
-
-       .save = drmmode_crt_save,
-       .restore = drmmode_crt_restore,
-       .mode_fixup = drmmode_crt_mode_fixup,
-       .prepare = drmmode_output_prepare,
-       .mode_set = drmmode_crt_mode_set,
-       .commit = drmmode_output_commit,
-#endif
         .detect = drmmode_output_detect,
         .mode_valid = drmmode_output_mode_valid,

@@ -3470,9 +3461,6 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
                     !xf86HandleColormaps(pScreen, 256, 10,
                                          NULL, NULL,
                                          CMAP_PALETTED_TRUECOLOR
-#if 0                          /* This option messes up text mode! (eich@suse.de) */
-                                        | CMAP_LOAD_EVEN_IF_OFFSCREEN
-#endif
                                          | CMAP_RELOAD_ON_MODE_SWITCH))
                         return FALSE;
         }
--
2.18.0

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

[-- Attachment #1.2: Type: text/html, Size: 5039 bytes --]

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

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap
       [not found]     ` <20180627163941.18737-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-06-27 18:41       ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2018-06-27 18:41 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: amd-gfx list

On Wed, Jun 27, 2018 at 12:39 PM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Instead of from drmmode_set_mode_major. There's no need to re-set the
> gamma LUT on every modeset, the kernel should preserve it.
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  src/drmmode_display.c | 29 +++++++++++++++++------------
>  1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 5fe49b607..9364a885a 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -1353,12 +1353,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
>                 else
>                         drmmode_crtc->scanout_id = 0;
>
> -               /* gamma is disabled in kernel driver for deep color */
> -               if (pScrn->depth != 30)
> -                       drmmode_crtc_gamma_do_set(
> -                               crtc, crtc->gamma_red, crtc->gamma_green,
> -                               crtc->gamma_blue, crtc->gamma_size);
> -
>                 if (drmmode_crtc->prime_scanout_pixmap) {
>                         drmmode_crtc_prime_scanout_update(crtc, mode, scanout_id,
>                                                           &fb, &x, &y);
> @@ -3450,6 +3444,7 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
>  Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
>  {
>         xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
> +       int i;
>
>         if (xf86_config->num_crtc) {
>                 xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
> @@ -3457,13 +3452,23 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
>                 if (!miCreateDefColormap(pScreen))
>                         return FALSE;
>                 /* All radeons support 10 bit CLUTs. They get bypassed at depth 30. */
> -               if (pScrn->depth != 30 &&
> -                   !xf86HandleColormaps(pScreen, 256, 10,
> -                                        NULL, NULL,
> -                                        CMAP_PALETTED_TRUECOLOR
> -                                        | CMAP_RELOAD_ON_MODE_SWITCH))
> -                       return FALSE;
> +               if (pScrn->depth != 30) {
> +                       if (!xf86HandleColormaps(pScreen, 256, 10, NULL, NULL,
> +                                                CMAP_PALETTED_TRUECOLOR
> +                                                | CMAP_RELOAD_ON_MODE_SWITCH))
> +                               return FALSE;
> +
> +                       for (i = 0; i < xf86_config->num_crtc; i++) {
> +                               xf86CrtcPtr crtc = xf86_config->crtc[i];
> +
> +                               drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red,
> +                                                         crtc->gamma_green,
> +                                                         crtc->gamma_blue,
> +                                                         crtc->gamma_size);
> +                       }
> +               }
>         }
> +
>         return TRUE;
>  }
>
> --
> 2.18.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code
       [not found]     ` <CY4PR12MB13040D289B98AF5798E9C4EEFE480-rpdhrqHFk05fmUFYn07qFQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-06-28  8:26       ` Michel Dänzer
       [not found]         ` <f08efa46-1598-1402-2ba2-757d8bd9b841-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Michel Dänzer @ 2018-06-28  8:26 UTC (permalink / raw)
  To: Abramov, Slava; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-06-27 08:29 PM, Abramov, Slava wrote:
> I wonder how '#if 0' made its way upstream, but besides this

It was inherited from xf86-video-ati, where it's been in
drmmode_display.c since that file was first added (in 2009).


> Reviewed-by: Slava Abramov <slava.abramov@amd.com>

Thanks Slava (and Alex)! Is that only for this patch, or also for patch
2 of the series?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code
       [not found]         ` <f08efa46-1598-1402-2ba2-757d8bd9b841-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-06-28 15:38           ` Abramov, Slava
  0 siblings, 0 replies; 6+ messages in thread
From: Abramov, Slava @ 2018-06-28 15:38 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


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

Michel,

My review is only for the first patch.


Slava
________________________________
From: Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
Sent: Thursday, June 28, 2018 4:26:28 AM
To: Abramov, Slava
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code

On 2018-06-27 08:29 PM, Abramov, Slava wrote:
> I wonder how '#if 0' made its way upstream, but besides this

It was inherited from xf86-video-ati, where it's been in
drmmode_display.c since that file was first added (in 2009).


> Reviewed-by: Slava Abramov <slava.abramov-5C7GfCeVMHo@public.gmane.org>

Thanks Slava (and Alex)! Is that only for this patch, or also for patch
2 of the series?


--
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

[-- Attachment #1.2: Type: text/html, Size: 2083 bytes --]

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-28 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 16:39 [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code Michel Dänzer
     [not found] ` <20180627163941.18737-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-27 16:39   ` [PATCH xf86-video-amdgpu 2/2] Call drmmode_crtc_gamma_do_set from drmmode_setup_colormap Michel Dänzer
     [not found]     ` <20180627163941.18737-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-27 18:41       ` Alex Deucher
2018-06-27 18:29   ` [PATCH xf86-video-amdgpu 1/2] Remove #if 0'd code Abramov, Slava
     [not found]     ` <CY4PR12MB13040D289B98AF5798E9C4EEFE480-rpdhrqHFk05fmUFYn07qFQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-06-28  8:26       ` Michel Dänzer
     [not found]         ` <f08efa46-1598-1402-2ba2-757d8bd9b841-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-06-28 15:38           ` Abramov, Slava

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.