[pkg-fso-commits] [SCM] xf86-video-glamo, SMedia Glamo video driver for X.Org branch, master, updated. upstream/0.0.0+20090707.git98c012f7-57-g9918e08
Thomas White
taw at bitwiz.org.uk
Fri Jan 8 13:24:46 UTC 2010
The following commit has been merged in the master branch:
commit 5f22287cc1a3b3e9e7f6e5f871c81fc0c93aec50
Author: Thomas White <taw at bitwiz.org.uk>
Date: Sun Aug 9 23:18:40 2009 +0100
Dispatch command buffer when cache is full
diff --git a/src/glamo-kms-exa.c b/src/glamo-kms-exa.c
index 9c98724..99fab0c 100644
--- a/src/glamo-kms-exa.c
+++ b/src/glamo-kms-exa.c
@@ -118,9 +118,40 @@ static const CARD8 GLAMOBltRop[16] = {
};
+/* Submit the prepared command sequence to the kernel */
+static void GlamoDRMDispatch(GlamoPtr pGlamo)
+{
+ drm_glamo_cmd_buffer_t cmdbuf;
+ int r;
+
+ cmdbuf.buf = (char *)pGlamo->cmdq_drm;
+ cmdbuf.bufsz = pGlamo->cmdq_drm_used * 2; /* -> bytes */
+ cmdbuf.nobjs = pGlamo->cmdq_obj_used;
+ cmdbuf.objs = pGlamo->cmdq_objs;
+ cmdbuf.obj_pos = pGlamo->cmdq_obj_pos;
+
+ r = drmCommandWrite(pGlamo->drm_fd, DRM_GLAMO_CMDBUF,
+ &cmdbuf, sizeof(cmdbuf));
+ if ( r != 0 ) {
+ xf86DrvMsg(pGlamo->pScreen->myNum, X_ERROR,
+ "DRM_GLAMO_CMDBUF failed\n");
+ }
+
+ /* Reset counts to zero for the next sequence */
+ pGlamo->cmdq_obj_used = 0;
+ pGlamo->cmdq_drm_used = 0;
+}
+
+
static inline void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg,
uint16_t val)
{
+ if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
+ xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
+ "Forced command cache flush.\n");
+ GlamoDRMDispatch(pGlamo);
+ }
+
/* Record command */
pGlamo->cmdq_drm[pGlamo->cmdq_drm_used++] = reg;
pGlamo->cmdq_drm[pGlamo->cmdq_drm_used++] = val;
@@ -130,6 +161,12 @@ static inline void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg,
static inline void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg,
struct glamo_bo *bo)
{
+ if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
+ xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
+ "Forced command cache flush.\n");
+ GlamoDRMDispatch(pGlamo);
+ }
+
/* Record object position */
pGlamo->cmdq_objs[pGlamo->cmdq_obj_used] = bo->handle;
/* -> bytes */
@@ -144,31 +181,6 @@ static inline void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg,
}
-/* Submit the prepared command sequence to the kernel */
-static void GlamoDRMDispatch(GlamoPtr pGlamo)
-{
- drm_glamo_cmd_buffer_t cmdbuf;
- int r;
-
- cmdbuf.buf = (char *)pGlamo->cmdq_drm;
- cmdbuf.bufsz = pGlamo->cmdq_drm_used * 2; /* -> bytes */
- cmdbuf.nobjs = pGlamo->cmdq_obj_used;
- cmdbuf.objs = pGlamo->cmdq_objs;
- cmdbuf.obj_pos = pGlamo->cmdq_obj_pos;
-
- r = drmCommandWrite(pGlamo->drm_fd, DRM_GLAMO_CMDBUF,
- &cmdbuf, sizeof(cmdbuf));
- if ( r != 0 ) {
- xf86DrvMsg(pGlamo->pScreen->myNum, X_ERROR,
- "DRM_GLAMO_CMDBUF failed\n");
- }
-
- /* Reset counts to zero for the next sequence */
- pGlamo->cmdq_obj_used = 0;
- pGlamo->cmdq_drm_used = 0;
-}
-
-
unsigned int driGetPixmapHandle(PixmapPtr pPixmap, unsigned int *flags)
{
struct glamo_exa_pixmap_priv *priv;
--
xf86-video-glamo, SMedia Glamo video driver for X.Org
More information about the pkg-fso-commits
mailing list