Skip to content

Commit

Permalink
drm/i915: split display functions by chip type
Browse files Browse the repository at this point in the history
This patch splits out several of the display functions into a separate
display function table to avoid tons of chipset specific if..else
if..else if blocks all over.  There are more opportunities for this
(some noted in the structure defintition); so more cleanup patches will
follow.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
  • Loading branch information
Jesse Barnes authored and Eric Anholt committed Sep 21, 2009
1 parent 8542a0b commit e70236a
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 98 deletions.
20 changes: 20 additions & 0 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@ struct drm_i915_error_state {
struct timeval time;
};

struct drm_i915_display_funcs {
void (*dpms)(struct drm_crtc *crtc, int mode);
bool (*fbc_enabled)(struct drm_crtc *crtc);
void (*enable_fbc)(struct drm_crtc *crtc, unsigned long interval);
void (*disable_fbc)(struct drm_device *dev);
int (*get_display_clock_speed)(struct drm_device *dev);
int (*get_fifo_size)(struct drm_device *dev, int plane);
void (*update_wm)(struct drm_device *dev, int planea_clock,
int planeb_clock, int sr_hdisplay, int pixel_size);
/* clock updates for mode set */
/* cursor updates */
/* render clock increase/decrease */
/* display clock increase/decrease */
/* pll clock increase/decrease */
/* clock gating init */
};

typedef struct drm_i915_private {
struct drm_device *dev;

Expand Down Expand Up @@ -252,6 +269,9 @@ typedef struct drm_i915_private {
struct work_struct error_work;
struct workqueue_struct *wq;

/* Display functions */
struct drm_i915_display_funcs display;

/* Register state */
bool suspended;
u8 saveLBB;
Expand Down
Loading

0 comments on commit e70236a

Please sign in to comment.