diff options
author | Jesse Barnes <jesse.barnes@intel.com> | 2008-01-30 18:59:12 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-01-30 18:59:12 +0800 |
commit | 2e43bec8731ba1b172f7a0bf867bbb5c1adbda2d (patch) | |
tree | 01116531e6eb61bfd2ed3a7453c0613d6d4e47d7 /src/i830_memory.c | |
parent | bf629466a46c4037ec7b7cc5ee16be947618bd68 (diff) |
Frame buffer compression support on new chipset
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r-- | src/i830_memory.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index 07e4010e..d97ca0b9 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -1274,6 +1274,13 @@ i830_allocate_cursor_buffers(ScrnInfoPtr pScrn) static void i830_setup_fb_compression(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); + unsigned long compressed_size; + unsigned long fb_height; + + if (pScrn->virtualX > pScrn->virtualY) + fb_height = pScrn->virtualX; + else + fb_height = pScrn->virtualY; /* Only mobile chips since 845 support this feature */ if (!IS_MOBILE(pI830)) { @@ -1281,11 +1288,12 @@ static void i830_setup_fb_compression(ScrnInfoPtr pScrn) goto out; } - /* Clear out any stale state */ - OUTREG(FBC_CFB_BASE, 0); - OUTREG(FBC_LL_BASE, 0); - OUTREG(FBC_CONTROL2, 0); - OUTREG(FBC_CONTROL, 0); + if (IS_IGD_GM(pI830)) { + /* Update i830_display.c too if compression ratio changes */ + compressed_size = fb_height * (pScrn->displayWidth / 4); + } else { + compressed_size = MB(6); + } /* * Compressed framebuffer limitations: @@ -1300,21 +1308,23 @@ static void i830_setup_fb_compression(ScrnInfoPtr pScrn) */ pI830->compressed_front_buffer = i830_allocate_memory(pScrn, "compressed frame buffer", - MB(6), KB(4), NEED_PHYSICAL_ADDR); + compressed_size, KB(4), NEED_PHYSICAL_ADDR); if (!pI830->compressed_front_buffer) { pI830->fb_compression = FALSE; goto out; } - pI830->compressed_ll_buffer = - i830_allocate_memory(pScrn, "compressed ll buffer", - FBC_LL_SIZE + FBC_LL_PAD, KB(4), - NEED_PHYSICAL_ADDR); - if (!pI830->compressed_ll_buffer) { - i830_free_memory(pScrn, pI830->compressed_front_buffer); - pI830->fb_compression = FALSE; - goto out; + if (!IS_IGD_GM(pI830)) { + pI830->compressed_ll_buffer = + i830_allocate_memory(pScrn, "compressed ll buffer", + FBC_LL_SIZE + FBC_LL_PAD, KB(4), + NEED_PHYSICAL_ADDR); + if (!pI830->compressed_ll_buffer) { + i830_free_memory(pScrn, pI830->compressed_front_buffer); + pI830->fb_compression = FALSE; + goto out; + } } out: |