Skip to content

Commit

Permalink
intelfb -- uses stride alignment of 64 on the 9xx chipsets.
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Munsie <dmunsie@cecropia.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Dennis Munsie authored and Dave Airlie committed May 27, 2006
1 parent 51d7974 commit df7df8a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/video/intelfb/intelfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#define INTEL_REG_SIZE 0x80000

#define STRIDE_ALIGNMENT 16
#define STRIDE_ALIGNMENT_I9XX 64

#define PALETTE_8_ENTRIES 256

Expand Down
5 changes: 4 additions & 1 deletion drivers/video/intelfb/intelfbdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,10 @@ update_dinfo(struct intelfb_info *dinfo, struct fb_var_screeninfo *var)
}

/* Make sure the line length is a aligned correctly. */
dinfo->pitch = ROUND_UP_TO(dinfo->pitch, STRIDE_ALIGNMENT);
if (IS_I9XX(dinfo))
dinfo->pitch = ROUND_UP_TO(dinfo->pitch, STRIDE_ALIGNMENT_I9XX);
else
dinfo->pitch = ROUND_UP_TO(dinfo->pitch, STRIDE_ALIGNMENT);

if (FIXED_MODE(dinfo))
dinfo->pitch = dinfo->initial_pitch;
Expand Down
7 changes: 5 additions & 2 deletions drivers/video/intelfb/intelfbhw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ intelfbhw_mode_to_hw(struct intelfb_info *dinfo, struct intelfb_hwstate *hw,
u32 vsync_start, vsync_end, vblank_start, vblank_end, vtotal, vactive;
u32 vsync_pol, hsync_pol;
u32 *vs, *vb, *vt, *hs, *hb, *ht, *ss, *pipe_conf;
u32 stride_alignment;

DBG_MSG("intelfbhw_mode_to_hw\n");

Expand Down Expand Up @@ -1216,9 +1217,11 @@ intelfbhw_mode_to_hw(struct intelfb_info *dinfo, struct intelfb_hwstate *hw,
hw->disp_a_base += dinfo->fb.offset << 12;

/* Check stride alignment. */
if (hw->disp_a_stride % STRIDE_ALIGNMENT != 0) {
stride_alignment = IS_I9XX(dinfo) ? STRIDE_ALIGNMENT_I9XX :
STRIDE_ALIGNMENT;
if (hw->disp_a_stride % stride_alignment != 0) {
WRN_MSG("display stride %d has bad alignment %d\n",
hw->disp_a_stride, STRIDE_ALIGNMENT);
hw->disp_a_stride, stride_alignment);
return 1;
}

Expand Down

0 comments on commit df7df8a

Please sign in to comment.