Skip to content

Commit de52bca

Browse files
committed
Merge remote branch 'keithp/drm-intel-fixes' of /ssd/git/drm-next into drm-fixes
* 'keithp/drm-intel-fixes' of /ssd/git/drm-next: drm/i915: Add a no lvds quirk for the Asus EeeBox PC EB1007 drm/i915: Share the common force-audio property between connectors drm/i915: Remove unused enum "chip_family" drm/915: fix relaxed tiling on gen2: tile height drm/i915/crt: Explicitly return false if connected to a digital monitor drm/i915: Replace ironlake_compute_wm0 with g4x_compute_wm0 drm/i915: Only print out the actual number of fences for i915_error_state drm/i915: s/addr & ~PAGE_MASK/offset_in_page(addr)/ drm: i915: correct return status in intel_hdmi_mode_valid() drm/i915: fix regression after clock gating init split drm/i915: fix if statement in ivybridge irq handler
2 parents 59c5f46 + 6a574b5 commit de52bca

File tree

12 files changed

+87
-128
lines changed

12 files changed

+87
-128
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int i915_error_state(struct seq_file *m, void *unused)
776776
seq_printf(m, " INSTPM: 0x%08x\n", error->instpm);
777777
seq_printf(m, " seqno: 0x%08x\n", error->seqno);
778778

779-
for (i = 0; i < 16; i++)
779+
for (i = 0; i < dev_priv->num_fence_regs; i++)
780780
seq_printf(m, " fence[%d] = %08llx\n", i, error->fence[i]);
781781

782782
if (error->active_bo)

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ typedef struct drm_i915_private {
716716
struct intel_fbdev *fbdev;
717717

718718
struct drm_property *broadcast_rgb_property;
719+
struct drm_property *force_audio_property;
719720

720721
atomic_t forcewake_count;
721722
} drm_i915_private_t;
@@ -909,13 +910,6 @@ struct drm_i915_file_private {
909910
} mm;
910911
};
911912

912-
enum intel_chip_family {
913-
CHIP_I8XX = 0x01,
914-
CHIP_I9XX = 0x02,
915-
CHIP_I915 = 0x04,
916-
CHIP_I965 = 0x08,
917-
};
918-
919913
#define INTEL_INFO(dev) (((struct drm_i915_private *) (dev)->dev_private)->info)
920914

921915
#define IS_I830(dev) ((dev)->pci_device == 0x3577)

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ i915_gem_shmem_pread_fast(struct drm_device *dev,
354354
* page_offset = offset within page
355355
* page_length = bytes to copy for this page
356356
*/
357-
page_offset = offset & (PAGE_SIZE-1);
357+
page_offset = offset_in_page(offset);
358358
page_length = remain;
359359
if ((page_offset + remain) > PAGE_SIZE)
360360
page_length = PAGE_SIZE - page_offset;
@@ -453,9 +453,9 @@ i915_gem_shmem_pread_slow(struct drm_device *dev,
453453
* data_page_offset = offset with data_page_index page.
454454
* page_length = bytes to copy for this page
455455
*/
456-
shmem_page_offset = offset & ~PAGE_MASK;
456+
shmem_page_offset = offset_in_page(offset);
457457
data_page_index = data_ptr / PAGE_SIZE - first_data_page;
458-
data_page_offset = data_ptr & ~PAGE_MASK;
458+
data_page_offset = offset_in_page(data_ptr);
459459

460460
page_length = remain;
461461
if ((shmem_page_offset + page_length) > PAGE_SIZE)
@@ -638,8 +638,8 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev,
638638
* page_offset = offset within page
639639
* page_length = bytes to copy for this page
640640
*/
641-
page_base = (offset & ~(PAGE_SIZE-1));
642-
page_offset = offset & (PAGE_SIZE-1);
641+
page_base = offset & PAGE_MASK;
642+
page_offset = offset_in_page(offset);
643643
page_length = remain;
644644
if ((page_offset + remain) > PAGE_SIZE)
645645
page_length = PAGE_SIZE - page_offset;
@@ -650,7 +650,6 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev,
650650
*/
651651
if (fast_user_write(dev_priv->mm.gtt_mapping, page_base,
652652
page_offset, user_data, page_length))
653-
654653
return -EFAULT;
655654

656655
remain -= page_length;
@@ -730,9 +729,9 @@ i915_gem_gtt_pwrite_slow(struct drm_device *dev,
730729
* page_length = bytes to copy for this page
731730
*/
732731
gtt_page_base = offset & PAGE_MASK;
733-
gtt_page_offset = offset & ~PAGE_MASK;
732+
gtt_page_offset = offset_in_page(offset);
734733
data_page_index = data_ptr / PAGE_SIZE - first_data_page;
735-
data_page_offset = data_ptr & ~PAGE_MASK;
734+
data_page_offset = offset_in_page(data_ptr);
736735

737736
page_length = remain;
738737
if ((gtt_page_offset + page_length) > PAGE_SIZE)
@@ -791,7 +790,7 @@ i915_gem_shmem_pwrite_fast(struct drm_device *dev,
791790
* page_offset = offset within page
792791
* page_length = bytes to copy for this page
793792
*/
794-
page_offset = offset & (PAGE_SIZE-1);
793+
page_offset = offset_in_page(offset);
795794
page_length = remain;
796795
if ((page_offset + remain) > PAGE_SIZE)
797796
page_length = PAGE_SIZE - page_offset;
@@ -896,9 +895,9 @@ i915_gem_shmem_pwrite_slow(struct drm_device *dev,
896895
* data_page_offset = offset with data_page_index page.
897896
* page_length = bytes to copy for this page
898897
*/
899-
shmem_page_offset = offset & ~PAGE_MASK;
898+
shmem_page_offset = offset_in_page(offset);
900899
data_page_index = data_ptr / PAGE_SIZE - first_data_page;
901-
data_page_offset = data_ptr & ~PAGE_MASK;
900+
data_page_offset = offset_in_page(data_ptr);
902901

903902
page_length = remain;
904903
if ((shmem_page_offset + page_length) > PAGE_SIZE)
@@ -1450,8 +1449,9 @@ i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj)
14501449
* edge of an even tile row (where tile rows are counted as if the bo is
14511450
* placed in a fenced gtt region).
14521451
*/
1453-
if (IS_GEN2(dev) ||
1454-
(obj->tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)))
1452+
if (IS_GEN2(dev))
1453+
tile_height = 16;
1454+
else if (obj->tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))
14551455
tile_height = 32;
14561456
else
14571457
tile_height = 8;

drivers/gpu/drm/i915/i915_irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
517517
if (de_iir & DE_PIPEA_VBLANK_IVB)
518518
drm_handle_vblank(dev, 0);
519519

520-
if (de_iir & DE_PIPEB_VBLANK_IVB);
520+
if (de_iir & DE_PIPEB_VBLANK_IVB)
521521
drm_handle_vblank(dev, 1);
522522

523523
/* check event from PCH */

drivers/gpu/drm/i915/intel_crt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
288288
* This may be a DVI-I connector with a shared DDC
289289
* link between analog and digital outputs, so we
290290
* have to check the EDID input spec of the attached device.
291+
*
292+
* On the other hand, what should we do if it is a broken EDID?
291293
*/
292294
if (edid != NULL) {
293295
is_digital = edid->input & DRM_EDID_INPUT_DIGITAL;
@@ -298,6 +300,8 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
298300
if (!is_digital) {
299301
DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
300302
return true;
303+
} else {
304+
DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
301305
}
302306
}
303307

drivers/gpu/drm/i915/intel_display.c

Lines changed: 21 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3983,54 +3983,6 @@ static void i830_update_wm(struct drm_device *dev)
39833983
#define ILK_LP0_PLANE_LATENCY 700
39843984
#define ILK_LP0_CURSOR_LATENCY 1300
39853985

3986-
static bool ironlake_compute_wm0(struct drm_device *dev,
3987-
int pipe,
3988-
const struct intel_watermark_params *display,
3989-
int display_latency_ns,
3990-
const struct intel_watermark_params *cursor,
3991-
int cursor_latency_ns,
3992-
int *plane_wm,
3993-
int *cursor_wm)
3994-
{
3995-
struct drm_crtc *crtc;
3996-
int htotal, hdisplay, clock, pixel_size;
3997-
int line_time_us, line_count;
3998-
int entries, tlb_miss;
3999-
4000-
crtc = intel_get_crtc_for_pipe(dev, pipe);
4001-
if (crtc->fb == NULL || !crtc->enabled)
4002-
return false;
4003-
4004-
htotal = crtc->mode.htotal;
4005-
hdisplay = crtc->mode.hdisplay;
4006-
clock = crtc->mode.clock;
4007-
pixel_size = crtc->fb->bits_per_pixel / 8;
4008-
4009-
/* Use the small buffer method to calculate plane watermark */
4010-
entries = ((clock * pixel_size / 1000) * display_latency_ns) / 1000;
4011-
tlb_miss = display->fifo_size*display->cacheline_size - hdisplay * 8;
4012-
if (tlb_miss > 0)
4013-
entries += tlb_miss;
4014-
entries = DIV_ROUND_UP(entries, display->cacheline_size);
4015-
*plane_wm = entries + display->guard_size;
4016-
if (*plane_wm > (int)display->max_wm)
4017-
*plane_wm = display->max_wm;
4018-
4019-
/* Use the large buffer method to calculate cursor watermark */
4020-
line_time_us = ((htotal * 1000) / clock);
4021-
line_count = (cursor_latency_ns / line_time_us + 1000) / 1000;
4022-
entries = line_count * 64 * pixel_size;
4023-
tlb_miss = cursor->fifo_size*cursor->cacheline_size - hdisplay * 8;
4024-
if (tlb_miss > 0)
4025-
entries += tlb_miss;
4026-
entries = DIV_ROUND_UP(entries, cursor->cacheline_size);
4027-
*cursor_wm = entries + cursor->guard_size;
4028-
if (*cursor_wm > (int)cursor->max_wm)
4029-
*cursor_wm = (int)cursor->max_wm;
4030-
4031-
return true;
4032-
}
4033-
40343986
/*
40353987
* Check the wm result.
40363988
*
@@ -4139,12 +4091,12 @@ static void ironlake_update_wm(struct drm_device *dev)
41394091
unsigned int enabled;
41404092

41414093
enabled = 0;
4142-
if (ironlake_compute_wm0(dev, 0,
4143-
&ironlake_display_wm_info,
4144-
ILK_LP0_PLANE_LATENCY,
4145-
&ironlake_cursor_wm_info,
4146-
ILK_LP0_CURSOR_LATENCY,
4147-
&plane_wm, &cursor_wm)) {
4094+
if (g4x_compute_wm0(dev, 0,
4095+
&ironlake_display_wm_info,
4096+
ILK_LP0_PLANE_LATENCY,
4097+
&ironlake_cursor_wm_info,
4098+
ILK_LP0_CURSOR_LATENCY,
4099+
&plane_wm, &cursor_wm)) {
41484100
I915_WRITE(WM0_PIPEA_ILK,
41494101
(plane_wm << WM0_PIPE_PLANE_SHIFT) | cursor_wm);
41504102
DRM_DEBUG_KMS("FIFO watermarks For pipe A -"
@@ -4153,12 +4105,12 @@ static void ironlake_update_wm(struct drm_device *dev)
41534105
enabled |= 1;
41544106
}
41554107

4156-
if (ironlake_compute_wm0(dev, 1,
4157-
&ironlake_display_wm_info,
4158-
ILK_LP0_PLANE_LATENCY,
4159-
&ironlake_cursor_wm_info,
4160-
ILK_LP0_CURSOR_LATENCY,
4161-
&plane_wm, &cursor_wm)) {
4108+
if (g4x_compute_wm0(dev, 1,
4109+
&ironlake_display_wm_info,
4110+
ILK_LP0_PLANE_LATENCY,
4111+
&ironlake_cursor_wm_info,
4112+
ILK_LP0_CURSOR_LATENCY,
4113+
&plane_wm, &cursor_wm)) {
41624114
I915_WRITE(WM0_PIPEB_ILK,
41634115
(plane_wm << WM0_PIPE_PLANE_SHIFT) | cursor_wm);
41644116
DRM_DEBUG_KMS("FIFO watermarks For pipe B -"
@@ -4223,10 +4175,10 @@ static void sandybridge_update_wm(struct drm_device *dev)
42234175
unsigned int enabled;
42244176

42254177
enabled = 0;
4226-
if (ironlake_compute_wm0(dev, 0,
4227-
&sandybridge_display_wm_info, latency,
4228-
&sandybridge_cursor_wm_info, latency,
4229-
&plane_wm, &cursor_wm)) {
4178+
if (g4x_compute_wm0(dev, 0,
4179+
&sandybridge_display_wm_info, latency,
4180+
&sandybridge_cursor_wm_info, latency,
4181+
&plane_wm, &cursor_wm)) {
42304182
I915_WRITE(WM0_PIPEA_ILK,
42314183
(plane_wm << WM0_PIPE_PLANE_SHIFT) | cursor_wm);
42324184
DRM_DEBUG_KMS("FIFO watermarks For pipe A -"
@@ -4235,10 +4187,10 @@ static void sandybridge_update_wm(struct drm_device *dev)
42354187
enabled |= 1;
42364188
}
42374189

4238-
if (ironlake_compute_wm0(dev, 1,
4239-
&sandybridge_display_wm_info, latency,
4240-
&sandybridge_cursor_wm_info, latency,
4241-
&plane_wm, &cursor_wm)) {
4190+
if (g4x_compute_wm0(dev, 1,
4191+
&sandybridge_display_wm_info, latency,
4192+
&sandybridge_cursor_wm_info, latency,
4193+
&plane_wm, &cursor_wm)) {
42424194
I915_WRITE(WM0_PIPEB_ILK,
42434195
(plane_wm << WM0_PIPE_PLANE_SHIFT) | cursor_wm);
42444196
DRM_DEBUG_KMS("FIFO watermarks For pipe B -"
@@ -7675,6 +7627,7 @@ static void intel_init_display(struct drm_device *dev)
76757627
dev_priv->display.update_wm = NULL;
76767628
} else
76777629
dev_priv->display.update_wm = pineview_update_wm;
7630+
dev_priv->display.init_clock_gating = gen3_init_clock_gating;
76787631
} else if (IS_G4X(dev)) {
76797632
dev_priv->display.update_wm = g4x_update_wm;
76807633
dev_priv->display.init_clock_gating = g4x_init_clock_gating;

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ struct intel_dp {
5959
bool is_pch_edp;
6060
uint8_t train_set[4];
6161
uint8_t link_status[DP_LINK_STATUS_SIZE];
62-
63-
struct drm_property *force_audio_property;
6462
};
6563

6664
/**
@@ -1702,7 +1700,7 @@ intel_dp_set_property(struct drm_connector *connector,
17021700
if (ret)
17031701
return ret;
17041702

1705-
if (property == intel_dp->force_audio_property) {
1703+
if (property == dev_priv->force_audio_property) {
17061704
int i = val;
17071705
bool has_audio;
17081706

@@ -1841,16 +1839,7 @@ bool intel_dpd_is_edp(struct drm_device *dev)
18411839
static void
18421840
intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector)
18431841
{
1844-
struct drm_device *dev = connector->dev;
1845-
1846-
intel_dp->force_audio_property =
1847-
drm_property_create(dev, DRM_MODE_PROP_RANGE, "force_audio", 2);
1848-
if (intel_dp->force_audio_property) {
1849-
intel_dp->force_audio_property->values[0] = -1;
1850-
intel_dp->force_audio_property->values[1] = 1;
1851-
drm_connector_attach_property(connector, intel_dp->force_audio_property, 0);
1852-
}
1853-
1842+
intel_attach_force_audio_property(connector);
18541843
intel_attach_broadcast_rgb_property(connector);
18551844
}
18561845

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ struct intel_unpin_work {
236236
int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
237237
extern bool intel_ddc_probe(struct intel_encoder *intel_encoder, int ddc_bus);
238238

239+
extern void intel_attach_force_audio_property(struct drm_connector *connector);
239240
extern void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
240241

241242
extern void intel_crt_init(struct drm_device *dev);

drivers/gpu/drm/i915/intel_hdmi.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ struct intel_hdmi {
4545
bool has_hdmi_sink;
4646
bool has_audio;
4747
int force_audio;
48-
struct drm_property *force_audio_property;
4948
};
5049

5150
static struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder)
@@ -194,7 +193,7 @@ static int intel_hdmi_mode_valid(struct drm_connector *connector,
194193
if (mode->clock > 165000)
195194
return MODE_CLOCK_HIGH;
196195
if (mode->clock < 20000)
197-
return MODE_CLOCK_HIGH;
196+
return MODE_CLOCK_LOW;
198197

199198
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
200199
return MODE_NO_DBLESCAN;
@@ -287,7 +286,7 @@ intel_hdmi_set_property(struct drm_connector *connector,
287286
if (ret)
288287
return ret;
289288

290-
if (property == intel_hdmi->force_audio_property) {
289+
if (property == dev_priv->force_audio_property) {
291290
int i = val;
292291
bool has_audio;
293292

@@ -365,16 +364,7 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = {
365364
static void
366365
intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *connector)
367366
{
368-
struct drm_device *dev = connector->dev;
369-
370-
intel_hdmi->force_audio_property =
371-
drm_property_create(dev, DRM_MODE_PROP_RANGE, "force_audio", 2);
372-
if (intel_hdmi->force_audio_property) {
373-
intel_hdmi->force_audio_property->values[0] = -1;
374-
intel_hdmi->force_audio_property->values[1] = 1;
375-
drm_connector_attach_property(connector, intel_hdmi->force_audio_property, 0);
376-
}
377-
367+
intel_attach_force_audio_property(connector);
378368
intel_attach_broadcast_rgb_property(connector);
379369
}
380370

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
727727
DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
728728
},
729729
},
730+
{
731+
.callback = intel_no_lvds_dmi_callback,
732+
.ident = "Asus EeeBox PC EB1007",
733+
.matches = {
734+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
735+
DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
736+
},
737+
},
730738

731739
{ } /* terminating entry */
732740
};

0 commit comments

Comments
 (0)