@@ -1560,6 +1560,7 @@ typedef struct drm_i915_private {
struct drm_property *broadcast_rgb_property;
struct drm_property *force_audio_property;
+ struct drm_property *force_pfit_property;
uint32_t hw_context_size;
struct list_head context_list;
@@ -1613,6 +1614,13 @@ enum hdmi_force_audio {
HDMI_AUDIO_ON, /* force turn on HDMI audio */
};
+enum panel_fitter {
+ PFIT_OFF,
+ AUTOSCALE,
+ PILLARBOX,
+ LETTERBOX,
+};
+
#define I915_GTT_OFFSET_NONE ((u32)-1)
struct drm_i915_gem_object_ops {
@@ -819,6 +819,7 @@ int intel_connector_update_modes(struct drm_connector *connector,
int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
void intel_attach_force_audio_property(struct drm_connector *connector);
void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
+void intel_attach_force_pfit_property(struct drm_connector *connector);
/* intel_overlay.c */
@@ -28,6 +28,7 @@
#include <linux/fb.h>
#include <drm/drm_edid.h>
#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
#include "intel_drv.h"
#include "i915_drv.h"
@@ -126,3 +127,33 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector)
drm_object_attach_property(&connector->base, prop, 0);
}
+
+static const struct drm_prop_enum_list pfit_names[] = {
+ { PFIT_OFF, "pfit off" },
+ { AUTO_SCALE, "Auto scale" },
+ { PILLAR_BOX, "PillarBox" },
+ { LETTER_BOX, "LetterBox" },
+};
+
+void
+intel_attach_force_pfit_property(struct drm_connector *connector)
+{
+ struct drm_device *dev = connector->dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_property *prop;
+ struct drm_mode_object *obj = &connector->base;
+
+ prop = dev_priv->force_pfit_property;
+ if (prop == NULL) {
+ prop = drm_property_create_enum(dev, 0,
+ "pfit",
+ pfit_names,
+ ARRAY_SIZE(pfit_names));
+ if (prop == NULL)
+ return;
+
+ dev_priv->force_pfit_property = prop;
+ }
+
+ drm_object_attach_property(obj, prop, 0);
+}