Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

framebuffer: clean shutdown

  • Loading branch information...
commit 99b889a551f9be7854b24f94bcd75a7f81f18240 1 parent b7aec21
Sébastien Bourdeauducq authored July 12, 2012

Showing 1 changed file with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. 14  milkymist/framebuffer/__init__.py
14  milkymist/framebuffer/__init__.py
@@ -69,9 +69,10 @@ def get_registers(self):
69 69
 	def get_fragment(self):
70 70
 		# TODO: make address updates atomic
71 71
 		token = self.token("frame")
  72
+		stb = self.endpoints["frame"].stb
  73
+		ack = self.endpoints["frame"].ack
72 74
 		comb = [
73  
-			self.busy.eq(0),
74  
-			self.endpoints["frame"].stb.eq(self._enable.field.r),
  75
+			self.busy.eq(stb),
75 76
 			token.hres.eq(self._hres.field.r),
76 77
 			token.hsync_start.eq(self._hsync_start.field.r),
77 78
 			token.hsync_end.eq(self._hsync_end.field.r),
@@ -80,10 +81,15 @@ def get_fragment(self):
80 81
 			token.vsync_start.eq(self._vsync_start.field.r),
81 82
 			token.vsync_end.eq(self._vsync_end.field.r),
82 83
 			token.vscan.eq(self._vscan.field.r),
83  
-			token.base.eq(self._base.field.r[self._alignment_bits:]),
84 84
 			token.length.eq(self._length.field.r[self._alignment_bits:])
85 85
 		]
86  
-		return Fragment(comb)
  86
+		sync = [
  87
+			If(ack | ~stb,
  88
+				stb.eq(self._enable.field.r),
  89
+				token.base.eq(self._base.field.r[self._alignment_bits:])
  90
+			)
  91
+		]
  92
+		return Fragment(comb, sync)
87 93
 
88 94
 class VTG(Actor):
89 95
 	def __init__(self):

0 notes on commit 99b889a

Please sign in to comment.
Something went wrong with that request. Please try again.