|
@@ -12,8 +12,10 @@
|
|
|
* - 64x64 ARGB8888 cursor, MSB A:R:G:B, hotspot at (0,0); the mouse code
|
|
* - 64x64 ARGB8888 cursor, MSB A:R:G:B, hotspot at (0,0); the mouse code
|
|
|
* positions the image's top-left, so CURPOS takes negative values in
|
|
* positions the image's top-left, so CURPOS takes negative values in
|
|
|
* sign-magnitude form (bit 15 = X sign, bit 31 = Y sign).
|
|
* sign-magnitude form (bit 15 = X sign, bit 31 = Y sign).
|
|
|
- * - CURCNTR bit 31 enables, mode 0x27 is 64x64 ARGB, bits 29:28 hold the
|
|
|
|
|
- * pipe select. CURBASE is written after CURPOS to arm the update.
|
|
|
|
|
|
|
+ * - CURCNTR bit 31 enables, mode 0x27 is 64x64 ARGB. Gen5 has one cursor
|
|
|
|
|
+ * register per pipe, so bits 29:28 (the old pipe select) are reserved.
|
|
|
|
|
+ * The cursor gamma enable follows the matching primary plane's gamma
|
|
|
|
|
+ * enable; CURBASE is written after CURPOS to arm the update.
|
|
|
* - The GTT PTE is the physical page, its bits 35:32 in PTE bits 7:4, the
|
|
* - The GTT PTE is the physical page, its bits 35:32 in PTE bits 7:4, the
|
|
|
* uncached mapping type (0) and the valid bit (1).
|
|
* uncached mapping type (0) and the valid bit (1).
|
|
|
*/
|
|
*/
|
|
@@ -48,10 +50,10 @@
|
|
|
#define CUR_PIPE_B 0x40
|
|
#define CUR_PIPE_B 0x40
|
|
|
|
|
|
|
|
#define DSP_PLANE_ENABLE (1u << 31)
|
|
#define DSP_PLANE_ENABLE (1u << 31)
|
|
|
|
|
+#define DSP_PLANE_GAMMA_ENABLE (1u << 30)
|
|
|
#define CURSOR_ENABLE (1u << 31)
|
|
#define CURSOR_ENABLE (1u << 31)
|
|
|
#define CURSOR_GAMMA_ENABLE (1u << 26)
|
|
#define CURSOR_GAMMA_ENABLE (1u << 26)
|
|
|
#define CURSOR_MODE_64_ARGB 0x27u
|
|
#define CURSOR_MODE_64_ARGB 0x27u
|
|
|
-#define CURSOR_PIPE_SEL_SHIFT 28
|
|
|
|
|
|
|
|
|
|
#define CUR_SIZE 64
|
|
#define CUR_SIZE 64
|
|
|
#define CUR_BYTES (CUR_SIZE * CUR_SIZE * 4)
|
|
#define CUR_BYTES (CUR_SIZE * CUR_SIZE * 4)
|
|
@@ -222,10 +224,21 @@ static int intel_map_cursor(unsigned int slot)
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* The display palette (gamma LUT) sits after the plane blender on
|
|
|
|
|
+ * Ironlake. Enabling the cursor's gamma while the primary plane bypasses
|
|
|
|
|
+ * it sends only the cursor through the palette; on a VBE mode whose
|
|
|
|
|
+ * primary plane has gamma disabled that turns the antialiased cursor
|
|
|
|
|
+ * edges into a bright halo. Follow the matching primary plane's gamma
|
|
|
|
|
+ * enable instead. Gen5 has one cursor register per pipe, so the old
|
|
|
|
|
+ * (pre-Gen5) pipe-select field is reserved and must stay zero. */
|
|
|
static unsigned int cursor_ctrl(unsigned int pipe)
|
|
static unsigned int cursor_ctrl(unsigned int pipe)
|
|
|
{
|
|
{
|
|
|
- return CURSOR_ENABLE | CURSOR_GAMMA_ENABLE |
|
|
|
|
|
- CURSOR_MODE_64_ARGB | (pipe << CURSOR_PIPE_SEL_SHIFT);
|
|
|
|
|
|
|
+ unsigned int dsp = pipe ? DSPBCNTR : DSPACNTR;
|
|
|
|
|
+ unsigned int ctrl = CURSOR_ENABLE | CURSOR_MODE_64_ARGB;
|
|
|
|
|
+
|
|
|
|
|
+ if (mmio_read(dsp) & DSP_PLANE_GAMMA_ENABLE)
|
|
|
|
|
+ ctrl |= CURSOR_GAMMA_ENABLE;
|
|
|
|
|
+ return ctrl;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void intel_init(unsigned int bus, unsigned int dev, unsigned int device_id)
|
|
void intel_init(unsigned int bus, unsigned int dev, unsigned int device_id)
|
|
@@ -332,6 +345,10 @@ void intel_init(unsigned int bus, unsigned int dev, unsigned int device_id)
|
|
|
serial_puthex(SERIAL_COM1, intel_pipe_mask);
|
|
serial_puthex(SERIAL_COM1, intel_pipe_mask);
|
|
|
serial_puts(SERIAL_COM1, ", cursor ");
|
|
serial_puts(SERIAL_COM1, ", cursor ");
|
|
|
serial_puthex(SERIAL_COM1, intel_cursor_gtt);
|
|
serial_puthex(SERIAL_COM1, intel_cursor_gtt);
|
|
|
|
|
+ serial_puts(SERIAL_COM1, ", dspa ");
|
|
|
|
|
+ serial_puthex(SERIAL_COM1, dspa);
|
|
|
|
|
+ serial_puts(SERIAL_COM1, ", dspb ");
|
|
|
|
|
+ serial_puthex(SERIAL_COM1, dspb);
|
|
|
serial_puts(SERIAL_COM1, "\n");
|
|
serial_puts(SERIAL_COM1, "\n");
|
|
|
|
|
|
|
|
intel_probe_ok = 1;
|
|
intel_probe_ok = 1;
|