xf86-video-intel: 2 commits - src/bios_reader/bios_dumper.c src/i830_debug.c src/i830.h src/i830_lvds.c src/i830_render.c src/i830_video.c src/i915_render.c src/i965_render.c
Kristian Høgsberg
krh at kemper.freedesktop.org
Tue Mar 11 10:55:20 PDT 2008
src/bios_reader/bios_dumper.c | 1 +
src/i830.h | 7 +++++++
src/i830_debug.c | 28 +++++++++++++++++-----------
src/i830_lvds.c | 2 --
src/i830_render.c | 3 ++-
src/i830_video.c | 11 ++++++-----
src/i915_render.c | 3 ++-
src/i965_render.c | 3 ++-
8 files changed, 37 insertions(+), 21 deletions(-)
New commits:
commit 4ea67e9b853e9ed61557780b87bd184fc81fd731
Author: Kristian Høgsberg <krh at redhat.com>
Date: Tue Mar 11 13:54:33 2008 -0400
Crack down on warnings.
Fix printf formatting warnings, wrap a couple of long lines, nuke
unused variables, add missing #include <unistd.h>.
diff --git a/src/bios_reader/bios_dumper.c b/src/bios_reader/bios_dumper.c
index 6f163d5..e2f3064 100644
--- a/src/bios_reader/bios_dumper.c
+++ b/src/bios_reader/bios_dumper.c
@@ -31,6 +31,7 @@
#include <stdarg.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include <errno.h>
#include <pciaccess.h>
#include <err.h>
diff --git a/src/i830.h b/src/i830.h
index 132f089..c64a68f 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -843,4 +843,11 @@ extern const int I830CopyROP[16];
#define QUIRK_IVCH_NEED_DVOB 0x00000010
extern void i830_fixup_devices(ScrnInfoPtr);
+/* Mirrors CARD32 definition in Xmd.h */
+#ifdef LONG64
+#define CARD32_HEX "x"
+#else
+#define CARD32_HEX "lx"
+#endif
+
#endif /* _I830_H_ */
diff --git a/src/i830_debug.c b/src/i830_debug.c
index f589de7..2e8c851 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -957,13 +957,14 @@ i830_dump_error_state(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- ErrorF("pgetbl_ctl: 0x%" PRIx32 "getbl_err: 0x%" PRIx32 "\n",
+ ErrorF("pgetbl_ctl: 0x%" CARD32_HEX "getbl_err: 0x%" CARD32_HEX "\n",
INREG(PGETBL_CTL), INREG(PGE_ERR));
- ErrorF("ipeir: %" PRIx32 " iphdr: %" PRIx32 "\n", INREG(IPEIR),
+ ErrorF("ipeir: %" CARD32_HEX " iphdr: %" CARD32_HEX "\n", INREG(IPEIR),
INREG(IPEHR));
- ErrorF("LP ring tail: %" PRIx32 " head: %" PRIx32 " len: %" PRIx32 " start %" PRIx32 "\n",
+ ErrorF("LP ring tail: %" CARD32_HEX " head: %" CARD32_HEX
+ " len: %" CARD32_HEX " start %" CARD32_HEX "\n",
INREG(LP_RING + RING_TAIL),
INREG(LP_RING + RING_HEAD) & HEAD_ADDR,
INREG(LP_RING + RING_LEN),
@@ -974,8 +975,8 @@ i830_dump_error_state(ScrnInfoPtr pScrn)
ErrorF("instdone: %x instpm: %x\n", INREG16(INST_DONE), INREG8(INST_PM));
- ErrorF("memmode: %" PRIx32 " instps: %" PRIx32 "\n", INREG(MEMMODE),
- INREG(INST_PS));
+ ErrorF("memmode: %" CARD32_HEX " instps: %" CARD32_HEX "\n",
+ INREG(MEMMODE), INREG(INST_PS));
ErrorF("hwstam: %x ier: %x imr: %x iir: %x\n",
INREG16(HWSTAM), INREG16(IER), INREG16(IMR), INREG16(IIR));
@@ -987,12 +988,14 @@ i965_dump_error_state(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
- ErrorF("pgetbl_ctl: 0x%" PRIx32 " pgetbl_err: 0x%" PRIx32 "\n",
+ ErrorF("pgetbl_ctl: 0x%" CARD32_HEX " pgetbl_err: 0x%" CARD32_HEX "\n",
INREG(PGETBL_CTL), INREG(PGE_ERR));
- ErrorF("ipeir: %" PRIx32 " iphdr: %" PRIx32 "\n", INREG(IPEIR_I965), INREG(IPEHR_I965));
+ ErrorF("ipeir: %" CARD32_HEX " iphdr: %" CARD32_HEX "\n",
+ INREG(IPEIR_I965), INREG(IPEHR_I965));
- ErrorF("LP ring tail: %" PRIx32 " head: %" PRIx32 " len: %" PRIx32 " start %" PRIx32 "\n",
+ ErrorF("LP ring tail: %" CARD32_HEX " head: %" CARD32_HEX
+ " len: %" CARD32_HEX " start %" CARD32_HEX "\n",
INREG(LP_RING + RING_TAIL),
INREG(LP_RING + RING_HEAD) & HEAD_ADDR,
INREG(LP_RING + RING_LEN), INREG(LP_RING + RING_START));
@@ -1004,15 +1007,18 @@ i965_dump_error_state(ScrnInfoPtr pScrn)
(int)INREG(INST_DONE_1));
ErrorF("instpm: %x\n", (int)INREG(INST_PM));
- ErrorF("memmode: %" PRIx32 " instps: %" PRIx32 "\n", INREG(MEMMODE), INREG(INST_PS_I965));
+ ErrorF("memmode: %" CARD32_HEX " instps: %" CARD32_HEX "\n",
+ INREG(MEMMODE), INREG(INST_PS_I965));
ErrorF("HW Status mask (hwstam): %x\nIRQ enable (ier): %x "
"imr: %x iir: %x\n",
(int)INREG(HWSTAM), (int)INREG(IER), (int)INREG(IMR),
(int)INREG(IIR));
- ErrorF("acthd: %" PRIx32 " dma_fadd_p: %" PRIx32 "\n", INREG(ACTHD), INREG(DMA_FADD_P));
- ErrorF("ecoskpd: %" PRIx32 " excc: %" PRIx32 "\n", INREG(ECOSKPD), INREG(EXCC));
+ ErrorF("acthd: %" CARD32_HEX " dma_fadd_p: %" CARD32_HEX "\n",
+ INREG(ACTHD), INREG(DMA_FADD_P));
+ ErrorF("ecoskpd: %" CARD32_HEX " excc: %" CARD32_HEX "\n",
+ INREG(ECOSKPD), INREG(EXCC));
ErrorF("cache_mode: %x/%x\n", (int)INREG(CACHE_MODE_0),
(int)INREG(CACHE_MODE_1));
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 8359e39..eefb08b 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -855,8 +855,6 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property,
static Bool
i830_lvds_get_property(xf86OutputPtr output, Atom property)
{
- ScrnInfoPtr pScrn = output->scrn;
- I830Ptr pI830 = I830PTR(pScrn);
I830OutputPrivatePtr intel_output = output->driver_private;
struct i830_lvds_priv *dev_priv = intel_output->dev_priv;
int ret;
diff --git a/src/i830_video.c b/src/i830_video.c
index bf260e4..aa10cac 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -463,8 +463,8 @@ i830_overlay_continue(ScrnInfoPtr pScrn, Bool update_filter)
flip_addr = pI830->overlay_regs->bus_addr;
if (update_filter)
flip_addr |= OFC_UPDATE;
- OVERLAY_DEBUG ("overlay_continue cmd 0x%08" PRIx32 " -> 0x%08" PRIx32
- " sta 0x%08" PRIx32 "\n",
+ OVERLAY_DEBUG ("overlay_continue cmd 0x%08" CARD32_HEX
+ " -> 0x%08" CARD32_HEX " sta 0x%08" CARD32_HEX "\n",
overlay->OCMD, INREG(OCMD_REGISTER), INREG(DOVSTA));
BEGIN_LP_RING(4);
OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE);
@@ -504,7 +504,8 @@ i830_overlay_off(ScrnInfoPtr pScrn)
*/
{
overlay->OCMD &= ~OVERLAY_ENABLE;
- OVERLAY_DEBUG ("overlay_off cmd 0x%08" PRIx32 " -> 0x%08" PRIx32 " sta 0x%08" PRIx32 "\n",
+ OVERLAY_DEBUG ("overlay_off cmd 0x%08" CARD32_HEX
+ " -> 0x%08" CARD32_HEX " sta 0x%08" CARD32_HEX "\n",
overlay->OCMD, INREG(OCMD_REGISTER), INREG(DOVSTA));
BEGIN_LP_RING(6);
OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE);
@@ -1913,7 +1914,7 @@ i830_display_video(ScrnInfoPtr pScrn, xf86CrtcPtr crtc,
overlay->OBUF_1V = pPriv->VBuf1offset;
}
- OVERLAY_DEBUG("pos: 0x%" PRIx32 ", size: 0x%" PRIx32 "\n",
+ OVERLAY_DEBUG("pos: 0x%" CARD32_HEX ", size: 0x%" CARD32_HEX "\n",
overlay->DWINPOS, overlay->DWINSZ);
OVERLAY_DEBUG("dst: %d x %d, src: %d x %d\n", drw_w, drw_h, src_w, src_h);
@@ -2075,7 +2076,7 @@ i830_display_video(ScrnInfoPtr pScrn, xf86CrtcPtr crtc,
OCMD |= BUFFER1;
overlay->OCMD = OCMD;
- OVERLAY_DEBUG("OCMD is 0x%" PRIx32 "\n", OCMD);
+ OVERLAY_DEBUG("OCMD is 0x%" CARD32_HEX "\n", OCMD);
/* make sure the overlay is on */
i830_overlay_on (pScrn);
commit 9fd13e6773371c82b9799a5bda7c96ffa5cafe8c
Author: Kristian Høgsberg <krh at redhat.com>
Date: Tue Mar 11 13:48:07 2008 -0400
Silence warnings about possible uninitialize use of dst_format.
Whoa, gcc got a lot smarter about warnings. If iXXX_get_dest_format()
doesn't support the picture format passed in it won't initialize the
uint32_t pointed to by dst_format and return FALSE.
What gcc now can detect is if dst_format is used without checking the
return value, it might be used uninitialized. This patch makes sure
we always check the return value before using dst_format.
diff --git a/src/i830_render.c b/src/i830_render.c
index 22e09c8..ed44b36 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -403,7 +403,8 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture,
IntelEmitInvarientState(pScrn);
*pI830->last_3d = LAST_3D_RENDER;
- i830_get_dest_format(pDstPicture, &dst_format);
+ if (!i830_get_dest_format(pDstPicture, &dst_format))
+ return FALSE;
dst_offset = intel_get_pixmap_offset(pDst);
dst_pitch = intel_get_pixmap_pitch(pDst);
diff --git a/src/i915_render.c b/src/i915_render.c
index ca85bf7..0142f5e 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -322,7 +322,8 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
IntelEmitInvarientState(pScrn);
*pI830->last_3d = LAST_3D_RENDER;
- i915_get_dest_format(pDstPicture, &dst_format);
+ if (!i915_get_dest_format(pDstPicture, &dst_format))
+ return FALSE;
dst_offset = intel_get_pixmap_offset(pDst);
dst_pitch = intel_get_pixmap_pitch(pDst);
FS_LOCALS(20);
diff --git a/src/i965_render.c b/src/i965_render.c
index 4b1d7f3..a749301 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -629,7 +629,8 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
memset(dest_surf_state, 0, sizeof(*dest_surf_state));
dest_surf_state->ss0.surface_type = BRW_SURFACE_2D;
dest_surf_state->ss0.data_return_format = BRW_SURFACERETURNFORMAT_FLOAT32;
- i965_get_dest_format(pDstPicture, &dst_format);
+ if (!i965_get_dest_format(pDstPicture, &dst_format))
+ return FALSE;
dest_surf_state->ss0.surface_format = dst_format;
dest_surf_state->ss0.writedisable_alpha = 0;
More information about the xorg-commit
mailing list