Commit a1b952d4 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Introduce intel_drrs_type_str()

Add helper to get the drrs type as a string, and use it
in a couple of places. Also pimp the debugfs output a bit
while at it.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-11-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent f0a57798
......@@ -22,6 +22,7 @@
#include "intel_fbdev.h"
#include "intel_hdcp.h"
#include "intel_hdmi.h"
#include "intel_panel.h"
#include "intel_pm.h"
#include "intel_psr.h"
#include "intel_sprite.h"
......@@ -1143,23 +1144,17 @@ static void drrs_status_per_crtc(struct seq_file *m,
{
struct drm_i915_private *dev_priv = to_i915(dev);
struct i915_drrs *drrs = &dev_priv->drrs;
struct drm_connector *connector;
struct intel_connector *connector;
struct drm_connector_list_iter conn_iter;
drm_connector_list_iter_begin(dev, &conn_iter);
drm_for_each_connector_iter(connector, &conn_iter) {
bool supported = false;
if (connector->state->crtc != &crtc->base)
for_each_intel_connector_iter(connector, &conn_iter) {
if (connector->base.state->crtc != &crtc->base)
continue;
seq_printf(m, "%s:\n", connector->name);
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP &&
dev_priv->vbt.drrs_type == DRRS_TYPE_SEAMLESS)
supported = true;
seq_printf(m, "\tDRRS Supported: %s\n", str_yes_no(supported));
seq_printf(m, "[CONNECTOR:%d:%s] DRRS type: %s\n",
connector->base.base.id, connector->base.name,
intel_drrs_type_str(intel_panel_drrs_type(connector)));
}
drm_connector_list_iter_end(&conn_iter);
......
......@@ -47,6 +47,20 @@
* requested by userspace.
*/
const char *intel_drrs_type_str(enum drrs_type drrs_type)
{
static const char * const str[] = {
[DRRS_TYPE_NONE] = "none",
[DRRS_TYPE_STATIC] = "static",
[DRRS_TYPE_SEAMLESS] = "seamless",
};
if (drrs_type >= ARRAY_SIZE(str))
return "<invalid>";
return str[drrs_type];
}
static bool can_enable_drrs(struct intel_connector *connector,
const struct intel_crtc_state *pipe_config)
{
......@@ -461,8 +475,9 @@ intel_drrs_init(struct intel_connector *connector,
dev_priv->drrs.refresh_rate = DRRS_REFRESH_RATE_HIGH;
drm_dbg_kms(&dev_priv->drm,
"[CONNECTOR:%d:%s] seamless DRRS supported\n",
connector->base.base.id, connector->base.name);
"[CONNECTOR:%d:%s] %s DRRS supported\n",
connector->base.base.id, connector->base.name,
intel_drrs_type_str(dev_priv->vbt.drrs_type));
return downclock_mode;
}
......@@ -8,6 +8,7 @@
#include <linux/types.h>
enum drrs_type;
struct drm_i915_private;
struct intel_atomic_state;
struct intel_crtc;
......@@ -15,6 +16,7 @@ struct intel_crtc_state;
struct intel_connector;
struct intel_dp;
const char *intel_drrs_type_str(enum drrs_type drrs_type);
void intel_drrs_enable(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state);
void intel_drrs_disable(struct intel_dp *intel_dp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment