From 52f9028c84baea81230dc673b756552e8e90aecd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Apr 2007 11:21:06 +1000 Subject: Initial import of modesetting for intel driver in DRM --- linux-core/intel_drv.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 linux-core/intel_drv.h (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h new file mode 100644 index 00000000..5b8bef69 --- /dev/null +++ b/linux-core/intel_drv.h @@ -0,0 +1,69 @@ +#ifndef __INTEL_DRV_H__ +#define __INTEL_DRV_H__ + +#include +#include +#include +#include "drm_crtc.h" + +/* + * Display related stuff + */ + +/* store information about an Ixxx DVO */ +/* The i830->i865 use multiple DVOs with multiple i2cs */ +/* the i915, i945 have a single sDVO i2c bus - which is different */ +#define MAX_OUTPUTS 6 + +#define INTEL_I2C_BUS_DVO 1 +#define INTEL_I2C_BUS_SDVO 2 + +/* these are outputs from the chip - integrated only + external chips are via DVO or SDVO output */ +#define INTEL_OUTPUT_UNUSED 0 +#define INTEL_OUTPUT_ANALOG 1 +#define INTEL_OUTPUT_DVO 2 +#define INTEL_OUTPUT_SDVO 3 +#define INTEL_OUTPUT_LVDS 4 +#define INTEL_OUTPUT_TVOUT 5 + +#define INTEL_DVO_CHIP_NONE 0 +#define INTEL_DVO_CHIP_LVDS 1 +#define INTEL_DVO_CHIP_TMDS 2 +#define INTEL_DVO_CHIP_TVOUT 4 + +struct intel_i2c_chan { + drm_device_t *drm_dev; /* for getting at dev. private (mmio etc.) */ + u32 reg; /* GPIO reg */ + struct i2c_adapter adapter; + struct i2c_algo_bit_data algo; + u8 slave_addr; +}; + +struct intel_output { + int type; + struct intel_i2c_chan *i2c_bus; /* for control functions */ + struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ + bool load_detect_tmp; + void *dev_priv; +}; + +struct intel_crtc { + int pipe; + u8 lut_r[256], lut_g[256], lut_b[256]; +}; + +struct intel_i2c_chan *intel_i2c_create(drm_device_t *dev, const u32 reg, + const char *name); +void intel_i2c_destroy(struct intel_i2c_chan *chan); +int intel_ddc_get_modes(struct drm_output *output); +extern bool intel_ddc_probe(struct drm_output *output); + +extern void intel_crt_init(drm_device_t *dev); +extern void intel_sdvo_init(drm_device_t *dev, int output_device); +extern void intel_lvds_init(drm_device_t *dev); + +extern void intel_crtc_load_lut(struct drm_crtc *crtc); +extern void intel_output_prepare (struct drm_output *output); +extern void intel_output_commit (struct drm_output *output); +#endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 6f3534a13abb0c8afb157511d0871dbc35bc403d Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 5 Apr 2007 09:21:31 -0700 Subject: Add copyrights before I forget --- linux-core/intel_drv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 5b8bef69..7b02d35f 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2006 Dave Airlie + * Copyright (c) 2007 Intel Corporation + * Jesse Barnes + */ #ifndef __INTEL_DRV_H__ #define __INTEL_DRV_H__ -- cgit v1.2.3 From 183cbd92dd016f8935f9b58ef9345fde1391173e Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Tue, 10 Apr 2007 09:47:37 -0700 Subject: Finish bringing in LVDS code, re-add to Makefile. Needed other changes too: - move EDID structures to drm_edid.h - add EDID info structure to drm_output - add a few routines to intel_display for getting current mode info - add some prototypes to intel_drv.h and drm_crtc.h --- linux-core/intel_drv.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 7b02d35f..0675e069 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -71,4 +71,7 @@ extern void intel_lvds_init(drm_device_t *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); extern void intel_output_prepare (struct drm_output *output); extern void intel_output_commit (struct drm_output *output); +extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, + struct drm_crtc *crtc); + #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From dd00aa5851ca7c5590ae0b0825dd84c027cfd420 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 11 Apr 2007 07:08:48 -0700 Subject: export vblank routine for use by intel_display.c and intel_sdvo.c. --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 0675e069..f47e6233 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -73,5 +73,6 @@ extern void intel_output_prepare (struct drm_output *output); extern void intel_output_commit (struct drm_output *output); extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, struct drm_crtc *crtc); +extern void intel_wait_for_vblank(drm_device_t *dev); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 9a39cb9b9a51516abcaf795fa6e38cbeb22d7db9 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 12 Apr 2007 12:43:47 -0700 Subject: Use crtc_from_pipe call in intel_lvds.c and add get_mode panel mode detection. Also fix up error case for when LVDS mode can't be determined. Leave placeholder code in place for BIOS mode probing and platform quirks. --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index f47e6233..aa33437d 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -74,5 +74,6 @@ extern void intel_output_commit (struct drm_output *output); extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, struct drm_crtc *crtc); extern void intel_wait_for_vblank(drm_device_t *dev); +extern struct drm_crtc *intel_get_crtc_from_pipe(drm_device_t *dev, int pipe); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 5ce8aaae7251e60c078eda0a21894aae0e1d7a45 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 May 2007 12:46:36 +0100 Subject: Large changes for fbdev support. Change from DIRECTCOLOR to TRUECOLOR, and enable support for PSEUDOCOLOR. DIRECTCOLOR support needs more work. Add the ability to change the mode on the fbdev device. Support depth 8, 15, 16 and 24 (and 32). Add a /dev/fbX device per CRTC, but there's some code which doesn't allocate the fbX device unless the output is actually enabled. Read the code on this as it impacts the fbcon map flags. Pick CRTC's based on the available outputs. More work could be done here to match modes, so cloning could be achieved on outputs. This fits more inline with what the X code does. --- linux-core/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index aa33437d..fdf260e9 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -72,7 +72,7 @@ extern void intel_crtc_load_lut(struct drm_crtc *crtc); extern void intel_output_prepare (struct drm_output *output); extern void intel_output_commit (struct drm_output *output); extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, - struct drm_crtc *crtc); + struct drm_crtc *crtc); extern void intel_wait_for_vblank(drm_device_t *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(drm_device_t *dev, int pipe); -- cgit v1.2.3 From a18b4befb9b76c4b2662ff6caa0e4f0975eb8e9c Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 17 May 2007 09:00:06 -0700 Subject: Fix FB pitch value (we had it wrong and were working around it in a few places). Add new FB hooks to the drm driver structure and make i915 use them for an Intel specific FB driver. This will allow acceleration and better handling of the command stream. --- linux-core/intel_drv.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index aa33437d..91112ff5 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -76,4 +76,7 @@ extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, extern void intel_wait_for_vblank(drm_device_t *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(drm_device_t *dev, int pipe); +extern int intelfb_probe(struct drm_device *dev, struct drm_framebuffer *fb); +extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); + #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 0c33a2cd2ec81478403d39b1b92aaa4431e7cf0a Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 18 May 2007 14:16:10 +0100 Subject: Move fbo creation to the specified fb driver which gives it a chance to allocate the memory from whichever buffer it wants to. --- linux-core/intel_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 9205b99b..0a03e37b 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -76,7 +76,7 @@ extern struct drm_display_mode *intel_crtc_mode_get(drm_device_t *dev, extern void intel_wait_for_vblank(drm_device_t *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(drm_device_t *dev, int pipe); -extern int intelfb_probe(struct drm_device *dev, struct drm_framebuffer *fb); -extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); +extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc); +extern int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From e239882b1e90cba0297118ec7dc432bea06b0bd0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 4 Dec 2007 15:36:36 +0100 Subject: Modesetting Hotplug --- linux-core/intel_drv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 7de4b924..06335b18 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -76,7 +76,12 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, extern void intel_wait_for_vblank(struct drm_device *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); +extern struct drm_output* intel_sdvo_find(struct drm_device *dev, int sdvoB); +extern int intel_sdvo_supports_hotplug(struct drm_output *output); +extern void intel_sdvo_set_hotplug(struct drm_output *output, int enable); + extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc); extern int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc); +extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From a2254c5a9670a3e865f0eb5acd46e905c9b146ce Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 28 Jan 2008 03:12:29 +0100 Subject: Added cursor support --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 06335b18..25c3a978 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -55,6 +55,7 @@ struct intel_output { struct intel_crtc { int pipe; + uint32_t cursor_adder; u8 lut_r[256], lut_g[256], lut_b[256]; }; -- cgit v1.2.3 From 2b1c9cd696049d23845870329d2b61a5873f7b13 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 15 Feb 2008 16:13:21 -0800 Subject: i915: initial (and untested) TV out support Ported from xf86-video-intel. Still need to tie in TV modes somehow, though preferably w/o using the properties mechanism. --- linux-core/intel_drv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 25c3a978..72ba01da 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -49,12 +49,13 @@ struct intel_output { int type; struct intel_i2c_chan *i2c_bus; /* for control functions */ struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ - bool load_detect_tmp; + bool load_detect_temp; void *dev_priv; }; struct intel_crtc { int pipe; + int plane; uint32_t cursor_adder; u8 lut_r[256], lut_g[256], lut_b[256]; }; -- cgit v1.2.3 From 52748d17923b7e501b707b950227864c0b64d8a1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 11 Mar 2008 11:49:27 +1000 Subject: drm: hopefully fix cursors on 965 --- linux-core/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 72ba01da..a36fd3f1 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -56,7 +56,7 @@ struct intel_output { struct intel_crtc { int pipe; int plane; - uint32_t cursor_adder; + uint32_t cursor_addr; u8 lut_r[256], lut_g[256], lut_b[256]; }; -- cgit v1.2.3 From 5a3ce06f3a3dfa9412b9660c1e1f35d24c815dbb Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Tue, 8 Apr 2008 12:42:23 -0700 Subject: Improved DRM sysfs support This patch ties outputs, output properties and hotplug events into the DRM core. Each output has a corresponding directory under the primary DRM device (usually card0) containing dpms, edid, modes, and connection status files. New hotplug change events occur when outputs are added or hotplug events are detected. --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index a36fd3f1..62e21a5e 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -68,6 +68,7 @@ extern bool intel_ddc_probe(struct drm_output *output); extern void intel_crt_init(struct drm_device *dev); extern void intel_sdvo_init(struct drm_device *dev, int output_device); +extern void intel_tv_init(struct drm_device *dev); extern void intel_lvds_init(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); -- cgit v1.2.3 From 6c92689dcc627886c32afd4eca8f0da25bd07183 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 9 Apr 2008 14:07:55 -0700 Subject: Port pipe reservation code for load detection TV out needs to do load detection, which means we have to find an available pipe to use for the detection. Port over the pipe reservation code for this purpose. --- linux-core/intel_drv.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 62e21a5e..51c52c84 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -58,6 +58,7 @@ struct intel_crtc { int plane; uint32_t cursor_addr; u8 lut_r[256], lut_g[256], lut_b[256]; + int dpms_mode; }; struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, @@ -78,6 +79,11 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_wait_for_vblank(struct drm_device *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); +extern struct drm_crtc *intel_get_load_detect_pipe(struct drm_output *output, + struct drm_display_mode *mode, + int *dpms_mode); +extern void intel_release_load_detect_pipe(struct drm_output *output, + int dpms_mode); extern struct drm_output* intel_sdvo_find(struct drm_device *dev, int sdvoB); extern int intel_sdvo_supports_hotplug(struct drm_output *output); -- cgit v1.2.3 From 21a93915d8a21518c5da76a739f9459ed7f99d6a Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Thu, 17 Apr 2008 16:51:00 +0800 Subject: Porting DVO stuff Ported from Xorg intel 2d driver. Changed interfaces definitions, which needed to be changed later if other device wants to use these DVO stuff. --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 51c52c84..e0e6b797 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -69,6 +69,7 @@ extern bool intel_ddc_probe(struct drm_output *output); extern void intel_crt_init(struct drm_device *dev); extern void intel_sdvo_init(struct drm_device *dev, int output_device); +extern void intel_dvo_init(struct drm_device *dev); extern void intel_tv_init(struct drm_device *dev); extern void intel_lvds_init(struct drm_device *dev); -- cgit v1.2.3 From 7bcbc443f4f5161ab1e1a11cb6694e6d6269377c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 8 May 2008 20:10:18 +0200 Subject: i915: Changed intel_fb to use the new drm_crtc_set_config interface --- linux-core/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index e0e6b797..6b89c000 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -90,7 +90,7 @@ extern struct drm_output* intel_sdvo_find(struct drm_device *dev, int sdvoB); extern int intel_sdvo_supports_hotplug(struct drm_output *output); extern void intel_sdvo_set_hotplug(struct drm_output *output, int enable); -extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc); +extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); extern int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); -- cgit v1.2.3 From a51e38548cfdece2978e9b5f0d6f0467ba7a7272 Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Fri, 9 May 2008 10:06:17 +0800 Subject: fix kernel oops when removing fb drm_crtc->fb may point to NULL, f.e X server will allocate a new fb and assign it to the CRTC at startup, when X server exits, it will destroy the allocated fb, making drm_crtc->fb points to NULL. --- linux-core/intel_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 6b89c000..e97117de 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -91,7 +91,7 @@ extern int intel_sdvo_supports_hotplug(struct drm_output *output); extern void intel_sdvo_set_hotplug(struct drm_output *output, int enable); extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); -extern int intelfb_remove(struct drm_device *dev, struct drm_crtc *crtc); +extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From df8cd54286fbae5903d8ede390ec4a11cb6c4b6c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 29 May 2008 14:02:14 +1000 Subject: modesetting: reorganise code into core and helper functions. This splits a lot of the core modesetting code out into a file of helper functions, that are only called from themselves and/or the driver. The driver gets called into more often or can call these functions from itself if it is a helper using driver. I've broken framebuffer resize doing this but I didn't like the API for that in any case. --- linux-core/intel_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index e97117de..9f8ca8dd 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -11,6 +11,7 @@ #include #include "drm_crtc.h" +#include "drm_crtc_helper.h" /* * Display related stuff */ -- cgit v1.2.3 From 98c5cf7f6fc51f1a8f5f90b3895009cd38dd8f22 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 11:25:41 +1000 Subject: modesetting: reorganise out crtc/outputs are allocated. Use subclassing from the drivers to allocate the objects. This saves two objects being allocated for each crtc/output and generally makes exit paths cleaner. --- linux-core/intel_drv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 9f8ca8dd..82d2d703 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -47,6 +47,7 @@ struct intel_i2c_chan { }; struct intel_output { + struct drm_output base; int type; struct intel_i2c_chan *i2c_bus; /* for control functions */ struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ @@ -55,6 +56,7 @@ struct intel_output { }; struct intel_crtc { + struct drm_crtc base; int pipe; int plane; uint32_t cursor_addr; @@ -62,6 +64,9 @@ struct intel_crtc { int dpms_mode; }; +#define to_intel_crtc(x) container_of(x, struct intel_crtc, base) +#define to_intel_output(x) container_of(x, struct intel_output, base) + struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, const char *name); void intel_i2c_destroy(struct intel_i2c_chan *chan); -- cgit v1.2.3 From 6aeef92c0cad784a5019ea90d97ab81f4e51fdd9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 13:57:27 +1000 Subject: drm: attach an encoder. Time to do some renaming on the connectors I think --- linux-core/intel_drv.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 82d2d703..3f0c1664 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -48,6 +48,8 @@ struct intel_i2c_chan { struct intel_output { struct drm_output base; + + struct drm_encoder enc; int type; struct intel_i2c_chan *i2c_bus; /* for control functions */ struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ -- cgit v1.2.3 From 9d38448ed33aaff324cc4bbe1e0878593e97d07d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 15:03:12 +1000 Subject: modesetting: the great renaming. Okay we have crtc, encoder and connectors. No more outputs exposed beyond driver internals I've broken intel tv connector stuff. Really for TV we should have one TV connector, with a sub property for the type of signal been driven over it --- linux-core/intel_drv.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 3f0c1664..44639525 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -47,7 +47,7 @@ struct intel_i2c_chan { }; struct intel_output { - struct drm_output base; + struct drm_connector base; struct drm_encoder enc; int type; @@ -72,8 +72,8 @@ struct intel_crtc { struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, const char *name); void intel_i2c_destroy(struct intel_i2c_chan *chan); -int intel_ddc_get_modes(struct drm_output *output); -extern bool intel_ddc_probe(struct drm_output *output); +int intel_ddc_get_modes(struct intel_output *intel_output); +extern bool intel_ddc_probe(struct intel_output *intel_output); extern void intel_crt_init(struct drm_device *dev); extern void intel_sdvo_init(struct drm_device *dev, int output_device); @@ -82,23 +82,23 @@ extern void intel_tv_init(struct drm_device *dev); extern void intel_lvds_init(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); -extern void intel_output_prepare (struct drm_output *output); -extern void intel_output_commit (struct drm_output *output); +extern void intel_connector_prepare (struct drm_connector *connector); +extern void intel_connector_commit (struct drm_connector *connector); extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_wait_for_vblank(struct drm_device *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); -extern struct drm_crtc *intel_get_load_detect_pipe(struct drm_output *output, +extern struct drm_crtc *intel_get_load_detect_pipe(struct drm_connector *connector, struct drm_display_mode *mode, int *dpms_mode); -extern void intel_release_load_detect_pipe(struct drm_output *output, +extern void intel_release_load_detect_pipe(struct drm_connector *connector, int dpms_mode); -extern struct drm_output* intel_sdvo_find(struct drm_device *dev, int sdvoB); -extern int intel_sdvo_supports_hotplug(struct drm_output *output); -extern void intel_sdvo_set_hotplug(struct drm_output *output, int enable); +extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); +extern int intel_sdvo_supports_hotplug(struct drm_connector *connector); +extern void intel_sdvo_set_hotplug(struct drm_connector *connector, int enable); -extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); +extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); -- cgit v1.2.3 From e439e74776b215d70d8e34e8aa9cea22179dcbc6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 10:05:54 +1000 Subject: drm/modesetting: another re-org of some internals. Move dpms into the helper functions. Move crtc into the encoder. Move disable unused functions into the helper. --- linux-core/intel_drv.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 44639525..0a5e350e 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -68,6 +68,7 @@ struct intel_crtc { #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) #define to_intel_output(x) container_of(x, struct intel_output, base) +#define enc_to_intel_output(x) container_of(x, struct intel_output, enc) struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, const char *name); @@ -82,16 +83,16 @@ extern void intel_tv_init(struct drm_device *dev); extern void intel_lvds_init(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); -extern void intel_connector_prepare (struct drm_connector *connector); -extern void intel_connector_commit (struct drm_connector *connector); +extern void intel_encoder_prepare (struct drm_encoder *encoder); +extern void intel_encoder_commit (struct drm_encoder *encoder); extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_wait_for_vblank(struct drm_device *dev); extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); -extern struct drm_crtc *intel_get_load_detect_pipe(struct drm_connector *connector, +extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_output *intel_output, struct drm_display_mode *mode, int *dpms_mode); -extern void intel_release_load_detect_pipe(struct drm_connector *connector, +extern void intel_release_load_detect_pipe(struct intel_output *intel_output, int dpms_mode); extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); -- cgit v1.2.3 From 46c78a2223802b9105a87b7125fd4872ab69c4ca Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 11:44:35 +1000 Subject: drm/modesetting: add best encoder finding for modesetting This asks the driver to suggest the best encoder for the connector during the pick crtcs stage. Need to also do this during mode setting stages --- linux-core/intel_drv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 0a5e350e..24287e37 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -85,6 +85,9 @@ extern void intel_lvds_init(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); extern void intel_encoder_prepare (struct drm_encoder *encoder); extern void intel_encoder_commit (struct drm_encoder *encoder); + +extern struct drm_encoder *intel_best_encoder(struct drm_connector *connector); + extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_wait_for_vblank(struct drm_device *dev); @@ -98,7 +101,6 @@ extern void intel_release_load_detect_pipe(struct intel_output *intel_output, extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); extern int intel_sdvo_supports_hotplug(struct drm_connector *connector); extern void intel_sdvo_set_hotplug(struct drm_connector *connector, int enable); - extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); -- cgit v1.2.3 From 4e7b24639808e5e1e2c05143028db1a3bc2812e9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 14:04:41 +1000 Subject: drm: add functions to get/set gamma ramps --- linux-core/intel_drv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 24287e37..210ed990 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -104,5 +104,6 @@ extern void intel_sdvo_set_hotplug(struct drm_connector *connector, int enable); extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); - +extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, + u16 blue, int regno); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 76a44f14d6339e5bc0c936ef4a360f6c152511bd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Jun 2008 11:59:28 +1000 Subject: drm/modesetting: overhaul the fb create/delete. Move TTM code into the driver --- linux-core/intel_drv.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 210ed990..46f0fbec 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -46,6 +46,12 @@ struct intel_i2c_chan { u8 slave_addr; }; +struct intel_framebuffer { + struct drm_framebuffer base; + struct drm_buffer_object *bo; + struct drm_bo_kmap_obj kmap; +}; + struct intel_output { struct drm_connector base; @@ -69,6 +75,7 @@ struct intel_crtc { #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) #define to_intel_output(x) container_of(x, struct intel_output, base) #define enc_to_intel_output(x) container_of(x, struct intel_output, enc) +#define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, const char *name); @@ -106,4 +113,8 @@ extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno); + +extern struct drm_framebuffer *intel_user_framebuffer_create(struct drm_device *dev, + struct drm_file *file_priv, + struct drm_mode_fb_cmd *mode_cmd); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3 From 967bd219116a4f20aec828b890a225d2f92afd0b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Jun 2008 11:11:22 +1000 Subject: modesetting: initial attempt at debonging fb --- linux-core/intel_drv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 46f0fbec..25e2a652 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -52,6 +52,7 @@ struct intel_framebuffer { struct drm_bo_kmap_obj kmap; }; + struct intel_output { struct drm_connector base; @@ -70,6 +71,7 @@ struct intel_crtc { uint32_t cursor_addr; u8 lut_r[256], lut_g[256], lut_b[256]; int dpms_mode; + struct intel_framebuffer *fbdev_fb; }; #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) @@ -108,7 +110,7 @@ extern void intel_release_load_detect_pipe(struct intel_output *intel_output, extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); extern int intel_sdvo_supports_hotplug(struct drm_connector *connector); extern void intel_sdvo_set_hotplug(struct drm_connector *connector, int enable); -extern int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); +extern int intelfb_probe(struct drm_device *dev); extern int intelfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, -- cgit v1.2.3 From 8387a232a3305d10c4ac4cd08f9ebd0888944e55 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 6 Jun 2008 12:02:51 +1000 Subject: intelfb: move mode sets into the intel crtcs better place to store them. --- linux-core/intel_drv.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 25e2a652..1008e271 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -20,6 +20,8 @@ /* The i830->i865 use multiple DVOs with multiple i2cs */ /* the i915, i945 have a single sDVO i2c bus - which is different */ #define MAX_OUTPUTS 6 +/* maximum connectors per crtcs in the mode set */ +#define INTELFB_CONN_LIMIT 4 #define INTEL_I2C_BUS_DVO 1 #define INTEL_I2C_BUS_SDVO 2 @@ -72,6 +74,8 @@ struct intel_crtc { u8 lut_r[256], lut_g[256], lut_b[256]; int dpms_mode; struct intel_framebuffer *fbdev_fb; + /* a mode_set for fbdev users on this crtc */ + struct drm_mode_set mode_set; }; #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) -- cgit v1.2.3 From 4a2e29bf9982165deeeabb5c585fc0a8a659f380 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 11 Jun 2008 15:59:01 -0700 Subject: Use GEM in modesetting Use GEM for ring buffer setup and framebuffer allocation. This means reworking the hardware status page stuff a bit (just use the basic range allocator for vram for now) and #ifdef'ing out the TTM & DRI2 code. Works well enough to load/unload several times and display fbcon on my T61 (though there's still some unexplained console corruption). --- linux-core/intel_drv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index 1008e271..bffbeef0 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -50,8 +50,7 @@ struct intel_i2c_chan { struct intel_framebuffer { struct drm_framebuffer base; - struct drm_buffer_object *bo; - struct drm_bo_kmap_obj kmap; + struct drm_gem_object *obj; }; -- cgit v1.2.3 From 840c9a305481ed59820bbd87fbcf78dd242d5702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 23 Sep 2008 16:52:06 +1000 Subject: Update intel modesetting to use mm_private instead of mm_handle. --- linux-core/intel_drv.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linux-core/intel_drv.h') diff --git a/linux-core/intel_drv.h b/linux-core/intel_drv.h index bffbeef0..256deac7 100644 --- a/linux-core/intel_drv.h +++ b/linux-core/intel_drv.h @@ -50,7 +50,6 @@ struct intel_i2c_chan { struct intel_framebuffer { struct drm_framebuffer base; - struct drm_gem_object *obj; }; @@ -119,7 +118,8 @@ extern int intelfb_resize(struct drm_device *dev, struct drm_crtc *crtc); extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno); -extern struct drm_framebuffer *intel_user_framebuffer_create(struct drm_device *dev, - struct drm_file *file_priv, - struct drm_mode_fb_cmd *mode_cmd); +extern struct drm_framebuffer * +intel_framebuffer_create(struct drm_device *dev, + struct drm_mode_fb_cmd *mode_cmd, + void *mm_private); #endif /* __INTEL_DRV_H__ */ -- cgit v1.2.3