Commit a497bfe9 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

Two regressions fixes from snowboarding land

* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: Revert hdmi HDP pin checks
  drm/i915: Handle untiled planes when computing their offsets
parents a3b1097c 202adf4b
...@@ -2001,18 +2001,29 @@ void intel_unpin_fb_obj(struct drm_i915_gem_object *obj) ...@@ -2001,18 +2001,29 @@ void intel_unpin_fb_obj(struct drm_i915_gem_object *obj)
/* Computes the linear offset to the base tile and adjusts x, y. bytes per pixel /* Computes the linear offset to the base tile and adjusts x, y. bytes per pixel
* is assumed to be a power-of-two. */ * is assumed to be a power-of-two. */
unsigned long intel_gen4_compute_offset_xtiled(int *x, int *y, unsigned long intel_gen4_compute_page_offset(int *x, int *y,
unsigned int bpp, unsigned int tiling_mode,
unsigned int cpp,
unsigned int pitch) unsigned int pitch)
{ {
int tile_rows, tiles; if (tiling_mode != I915_TILING_NONE) {
unsigned int tile_rows, tiles;
tile_rows = *y / 8; tile_rows = *y / 8;
*y %= 8; *y %= 8;
tiles = *x / (512/bpp);
*x %= 512/bpp; tiles = *x / (512/cpp);
*x %= 512/cpp;
return tile_rows * pitch * 8 + tiles * 4096; return tile_rows * pitch * 8 + tiles * 4096;
} else {
unsigned int offset;
offset = *y * pitch + *x * cpp;
*y = 0;
*x = (offset & 4095) / cpp;
return offset & -4096;
}
} }
static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb, static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
...@@ -2089,7 +2100,7 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -2089,7 +2100,7 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
if (INTEL_INFO(dev)->gen >= 4) { if (INTEL_INFO(dev)->gen >= 4) {
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_gen4_compute_offset_xtiled(&x, &y, intel_gen4_compute_page_offset(&x, &y, obj->tiling_mode,
fb->bits_per_pixel / 8, fb->bits_per_pixel / 8,
fb->pitches[0]); fb->pitches[0]);
linear_offset -= intel_crtc->dspaddr_offset; linear_offset -= intel_crtc->dspaddr_offset;
...@@ -2182,7 +2193,7 @@ static int ironlake_update_plane(struct drm_crtc *crtc, ...@@ -2182,7 +2193,7 @@ static int ironlake_update_plane(struct drm_crtc *crtc,
linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8); linear_offset = y * fb->pitches[0] + x * (fb->bits_per_pixel / 8);
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_gen4_compute_offset_xtiled(&x, &y, intel_gen4_compute_page_offset(&x, &y, obj->tiling_mode,
fb->bits_per_pixel / 8, fb->bits_per_pixel / 8,
fb->pitches[0]); fb->pitches[0]);
linear_offset -= intel_crtc->dspaddr_offset; linear_offset -= intel_crtc->dspaddr_offset;
......
...@@ -648,7 +648,8 @@ extern void intel_update_sprite_watermarks(struct drm_device *dev, int pipe, ...@@ -648,7 +648,8 @@ extern void intel_update_sprite_watermarks(struct drm_device *dev, int pipe,
extern void intel_update_linetime_watermarks(struct drm_device *dev, int pipe, extern void intel_update_linetime_watermarks(struct drm_device *dev, int pipe,
struct drm_display_mode *mode); struct drm_display_mode *mode);
extern unsigned long intel_gen4_compute_offset_xtiled(int *x, int *y, extern unsigned long intel_gen4_compute_page_offset(int *x, int *y,
unsigned int tiling_mode,
unsigned int bpp, unsigned int bpp,
unsigned int pitch); unsigned int pitch);
......
...@@ -793,28 +793,6 @@ bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, ...@@ -793,28 +793,6 @@ bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
return true; return true;
} }
static bool g4x_hdmi_connected(struct intel_hdmi *intel_hdmi)
{
struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_digital_port *intel_dig_port = hdmi_to_dig_port(intel_hdmi);
uint32_t bit;
switch (intel_dig_port->port) {
case PORT_B:
bit = PORTB_HOTPLUG_LIVE_STATUS;
break;
case PORT_C:
bit = PORTC_HOTPLUG_LIVE_STATUS;
break;
default:
bit = 0;
break;
}
return I915_READ(PORT_HOTPLUG_STAT) & bit;
}
static enum drm_connector_status static enum drm_connector_status
intel_hdmi_detect(struct drm_connector *connector, bool force) intel_hdmi_detect(struct drm_connector *connector, bool force)
{ {
...@@ -827,13 +805,6 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) ...@@ -827,13 +805,6 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
struct edid *edid; struct edid *edid;
enum drm_connector_status status = connector_status_disconnected; enum drm_connector_status status = connector_status_disconnected;
if (IS_G4X(dev) && !g4x_hdmi_connected(intel_hdmi))
return status;
else if (HAS_PCH_SPLIT(dev) &&
!ibx_digital_port_connected(dev_priv, intel_dig_port))
return status;
intel_hdmi->has_hdmi_sink = false; intel_hdmi->has_hdmi_sink = false;
intel_hdmi->has_audio = false; intel_hdmi->has_audio = false;
intel_hdmi->rgb_quant_range_selectable = false; intel_hdmi->rgb_quant_range_selectable = false;
......
...@@ -122,7 +122,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb, ...@@ -122,7 +122,7 @@ ivb_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
linear_offset = y * fb->pitches[0] + x * pixel_size; linear_offset = y * fb->pitches[0] + x * pixel_size;
sprsurf_offset = sprsurf_offset =
intel_gen4_compute_offset_xtiled(&x, &y, intel_gen4_compute_page_offset(&x, &y, obj->tiling_mode,
pixel_size, fb->pitches[0]); pixel_size, fb->pitches[0]);
linear_offset -= sprsurf_offset; linear_offset -= sprsurf_offset;
...@@ -295,7 +295,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb, ...@@ -295,7 +295,7 @@ ilk_update_plane(struct drm_plane *plane, struct drm_framebuffer *fb,
linear_offset = y * fb->pitches[0] + x * pixel_size; linear_offset = y * fb->pitches[0] + x * pixel_size;
dvssurf_offset = dvssurf_offset =
intel_gen4_compute_offset_xtiled(&x, &y, intel_gen4_compute_page_offset(&x, &y, obj->tiling_mode,
pixel_size, fb->pitches[0]); pixel_size, fb->pitches[0]);
linear_offset -= dvssurf_offset; linear_offset -= dvssurf_offset;
......
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