From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch
Subject: [PATCH 1/2] drm/i915: Add module parameter to force en-/disable dithering.
Date: Fri, 15 Sep 2017 17:48:24 +0200 [thread overview]
Message-ID: <20170915154825.13462-2-mario.kleiner.de@gmail.com> (raw)
In-Reply-To: <20170915154825.13462-1-mario.kleiner.de@gmail.com>
i915.enable_dithering allows to force dithering on all outputs
on (=1) or off (=0). The default is -1 for current automatic
per-pipe selection.
This is useful for debugging and for special case scenarios,
e.g., providing simulated 10 bpc output on 8 bpc digital sinks
if a 10 bpc framebuffer + rendering is in use.
A more flexible solution would be connector properties, like
other drivers (radeon, amdgpu, nouveau) already provide. A
global override via module parameter is useful even with such
connector properties, e.g., for scientific applications which
require strict control over dithering, to have an override
for DE's which may not expose such properties via some standard
protocol in a user-controllable way, e.g., afaik all currently
existing Wayland compositors.
Tested on Ironlake, IvyBridge, Haswell, Skylake.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
drivers/gpu/drm/i915/i915_params.c | 5 +++++
drivers/gpu/drm/i915/i915_params.h | 1 +
drivers/gpu/drm/i915/intel_display.c | 5 +++++
3 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 8ab003dca113..07ec3a96457c 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -65,6 +65,7 @@ struct i915_params i915 __read_mostly = {
.inject_load_failure = 0,
.enable_dpcd_backlight = false,
.enable_gvt = false,
+ .enable_dithering = -1,
};
module_param_named(modeset, i915.modeset, int, 0400);
@@ -257,3 +258,7 @@ MODULE_PARM_DESC(enable_dpcd_backlight,
module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
MODULE_PARM_DESC(enable_gvt,
"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
+
+module_param_named(enable_dithering, i915.enable_dithering, int, 0644);
+MODULE_PARM_DESC(enable_dithering,
+ "Enable dithering (-1=auto [default], 0=force off on all outputs, 1=force on on all outputs)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index ac844709c97e..7e365cd4fc91 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -54,6 +54,7 @@
func(int, edp_vswing); \
func(int, reset); \
func(unsigned int, inject_load_failure); \
+ func(int, enable_dithering); \
/* leave bools at the end to not create holes */ \
func(bool, alpha_support); \
func(bool, enable_cmd_parser); \
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0e93ec201fe3..bea471a96820 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10978,6 +10978,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
*/
pipe_config->dither = (pipe_config->pipe_bpp == 6*3) &&
!pipe_config->dither_force_disable;
+
+ /* Override of auto-selected dither mode via module parameter? */
+ if (i915.enable_dithering != -1)
+ pipe_config->dither = i915.enable_dithering > 0 ? true : false;
+
DRM_DEBUG_KMS("hw max bpp: %i, pipe bpp: %i, dithering: %i\n",
base_bpp, pipe_config->pipe_bpp, pipe_config->dither);
--
2.13.0.rc1.294.g07d810a77f
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-15 15:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 15:48 Module parameters to override color management/dithering Mario Kleiner
2017-09-15 15:48 ` Mario Kleiner [this message]
2017-09-15 15:48 ` [PATCH 2/2] drm/i915: Add module parameter to en-/disable hw color correction Mario Kleiner
2017-09-26 5:05 ` Daniel Vetter
2017-09-29 6:57 ` Mario Kleiner
2017-09-29 7:21 ` Daniel Vetter
2017-09-25 11:35 ` Module parameters to override color management/dithering Jani Nikula
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=20170915154825.13462-2-mario.kleiner.de@gmail.com \
--to=mario.kleiner.de@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.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