Skip to content

Commit

Permalink
drm: xlnx_mixer: Added module variable to enable/disable primary plane.
Browse files Browse the repository at this point in the history
Enabling primary plan by default is causing bandwidth of 2GB
To overcome such issues, this varilable is introduced in module,
which can be enable or disable using below sysfs commands:

Enable:
echo Y > /sys/module/xlnx_mixer/parameters/mixer_primary_enable

Disable:
echo N > /sys/module/xlnx_mixer/parameters/mixer_primary_enable

Signed-off-by: Nayan Bhavsar <nayan.bhavsar@xilinx.com>
  • Loading branch information
Nayan Bhavsar authored and Michal Simek committed Mar 26, 2021
1 parent 1e43a46 commit cbeb602
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/gpu/drm/xlnx/xlnx_mixer.c
Expand Up @@ -240,6 +240,10 @@ static const u32 color_table[] = {
DRM_FORMAT_XV20,
};

static bool xlnx_mixer_primary_enable = true;
module_param_named(mixer_primary_enable, xlnx_mixer_primary_enable, bool, 0600);
MODULE_PARM_DESC(mixer_primary_enable, "Enable mixer primary plane (default: 1)");

/*********************** Inline Functions/Macros *****************************/
#define to_mixer_hw(p) (&((p)->mixer->mixer_hw))
#define to_xlnx_crtc(x) container_of(x, struct xlnx_crtc, crtc)
Expand Down Expand Up @@ -743,6 +747,13 @@ static void xlnx_mix_layer_enable(struct xlnx_mix_hw *mixer,
{
struct xlnx_mix_layer_data *layer_data;
u32 curr_state;
struct xlnx_mix *mix;

mix = container_of(mixer, struct xlnx_mix, mixer_hw);
if (mix->drm_primary_layer->mixer_layer->id == id) {
if (!xlnx_mixer_primary_enable)
return;
}

/* Ensure layer is marked as 'active' by application before
* turning on in hardware. In some cases, layer register data
Expand Down

0 comments on commit cbeb602

Please sign in to comment.