psb_irq.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /**************************************************************************
  2. * Copyright (c) 2007, Intel Corporation.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  17. *
  18. * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
  19. * develop this driver.
  20. *
  21. **************************************************************************/
  22. /*
  23. */
  24. #include <drm/drmP.h>
  25. #include "psb_drv.h"
  26. #include "psb_reg.h"
  27. #include "psb_intel_reg.h"
  28. #include "power.h"
  29. /*
  30. * inline functions
  31. */
  32. static inline u32
  33. psb_pipestat(int pipe)
  34. {
  35. if (pipe == 0)
  36. return PIPEASTAT;
  37. if (pipe == 1)
  38. return PIPEBSTAT;
  39. if (pipe == 2)
  40. return PIPECSTAT;
  41. BUG();
  42. }
  43. static inline u32
  44. mid_pipe_event(int pipe)
  45. {
  46. if (pipe == 0)
  47. return _PSB_PIPEA_EVENT_FLAG;
  48. if (pipe == 1)
  49. return _MDFLD_PIPEB_EVENT_FLAG;
  50. if (pipe == 2)
  51. return _MDFLD_PIPEC_EVENT_FLAG;
  52. BUG();
  53. }
  54. static inline u32
  55. mid_pipe_vsync(int pipe)
  56. {
  57. if (pipe == 0)
  58. return _PSB_VSYNC_PIPEA_FLAG;
  59. if (pipe == 1)
  60. return _PSB_VSYNC_PIPEB_FLAG;
  61. if (pipe == 2)
  62. return _MDFLD_PIPEC_VBLANK_FLAG;
  63. BUG();
  64. }
  65. static inline u32
  66. mid_pipeconf(int pipe)
  67. {
  68. if (pipe == 0)
  69. return PIPEACONF;
  70. if (pipe == 1)
  71. return PIPEBCONF;
  72. if (pipe == 2)
  73. return PIPECCONF;
  74. BUG();
  75. }
  76. void
  77. psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
  78. {
  79. if ((dev_priv->pipestat[pipe] & mask) != mask) {
  80. u32 reg = psb_pipestat(pipe);
  81. dev_priv->pipestat[pipe] |= mask;
  82. /* Enable the interrupt, clear any pending status */
  83. if (gma_power_begin(dev_priv->dev, false)) {
  84. u32 writeVal = PSB_RVDC32(reg);
  85. writeVal |= (mask | (mask >> 16));
  86. PSB_WVDC32(writeVal, reg);
  87. (void) PSB_RVDC32(reg);
  88. gma_power_end(dev_priv->dev);
  89. }
  90. }
  91. }
  92. void
  93. psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
  94. {
  95. if ((dev_priv->pipestat[pipe] & mask) != 0) {
  96. u32 reg = psb_pipestat(pipe);
  97. dev_priv->pipestat[pipe] &= ~mask;
  98. if (gma_power_begin(dev_priv->dev, false)) {
  99. u32 writeVal = PSB_RVDC32(reg);
  100. writeVal &= ~mask;
  101. PSB_WVDC32(writeVal, reg);
  102. (void) PSB_RVDC32(reg);
  103. gma_power_end(dev_priv->dev);
  104. }
  105. }
  106. }
  107. void mid_enable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
  108. {
  109. if (gma_power_begin(dev_priv->dev, false)) {
  110. u32 pipe_event = mid_pipe_event(pipe);
  111. dev_priv->vdc_irq_mask |= pipe_event;
  112. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  113. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  114. gma_power_end(dev_priv->dev);
  115. }
  116. }
  117. void mid_disable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
  118. {
  119. if (dev_priv->pipestat[pipe] == 0) {
  120. if (gma_power_begin(dev_priv->dev, false)) {
  121. u32 pipe_event = mid_pipe_event(pipe);
  122. dev_priv->vdc_irq_mask &= ~pipe_event;
  123. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  124. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  125. gma_power_end(dev_priv->dev);
  126. }
  127. }
  128. }
  129. /**
  130. * Display controller interrupt handler for pipe event.
  131. *
  132. */
  133. static void mid_pipe_event_handler(struct drm_device *dev, int pipe)
  134. {
  135. struct drm_psb_private *dev_priv =
  136. (struct drm_psb_private *) dev->dev_private;
  137. uint32_t pipe_stat_val = 0;
  138. uint32_t pipe_stat_reg = psb_pipestat(pipe);
  139. uint32_t pipe_enable = dev_priv->pipestat[pipe];
  140. uint32_t pipe_status = dev_priv->pipestat[pipe] >> 16;
  141. uint32_t pipe_clear;
  142. uint32_t i = 0;
  143. spin_lock(&dev_priv->irqmask_lock);
  144. pipe_stat_val = PSB_RVDC32(pipe_stat_reg);
  145. pipe_stat_val &= pipe_enable | pipe_status;
  146. pipe_stat_val &= pipe_stat_val >> 16;
  147. spin_unlock(&dev_priv->irqmask_lock);
  148. /* Clear the 2nd level interrupt status bits
  149. * Sometimes the bits are very sticky so we repeat until they unstick */
  150. for (i = 0; i < 0xffff; i++) {
  151. PSB_WVDC32(PSB_RVDC32(pipe_stat_reg), pipe_stat_reg);
  152. pipe_clear = PSB_RVDC32(pipe_stat_reg) & pipe_status;
  153. if (pipe_clear == 0)
  154. break;
  155. }
  156. if (pipe_clear)
  157. dev_err(dev->dev,
  158. "%s, can't clear status bits for pipe %d, its value = 0x%x.\n",
  159. __func__, pipe, PSB_RVDC32(pipe_stat_reg));
  160. if (pipe_stat_val & PIPE_VBLANK_STATUS)
  161. drm_handle_vblank(dev, pipe);
  162. if (pipe_stat_val & PIPE_TE_STATUS)
  163. drm_handle_vblank(dev, pipe);
  164. }
  165. /*
  166. * Display controller interrupt handler.
  167. */
  168. static void psb_vdc_interrupt(struct drm_device *dev, uint32_t vdc_stat)
  169. {
  170. if (vdc_stat & _PSB_VSYNC_PIPEA_FLAG)
  171. mid_pipe_event_handler(dev, 0);
  172. if (vdc_stat & _PSB_VSYNC_PIPEB_FLAG)
  173. mid_pipe_event_handler(dev, 1);
  174. }
  175. irqreturn_t psb_irq_handler(DRM_IRQ_ARGS)
  176. {
  177. struct drm_device *dev = (struct drm_device *) arg;
  178. struct drm_psb_private *dev_priv =
  179. (struct drm_psb_private *) dev->dev_private;
  180. uint32_t vdc_stat, dsp_int = 0, sgx_int = 0;
  181. int handled = 0;
  182. spin_lock(&dev_priv->irqmask_lock);
  183. vdc_stat = PSB_RVDC32(PSB_INT_IDENTITY_R);
  184. if (vdc_stat & _PSB_PIPE_EVENT_FLAG)
  185. dsp_int = 1;
  186. /* FIXME: Handle Medfield
  187. if (vdc_stat & _MDFLD_DISP_ALL_IRQ_FLAG)
  188. dsp_int = 1;
  189. */
  190. if (vdc_stat & _PSB_IRQ_SGX_FLAG)
  191. sgx_int = 1;
  192. vdc_stat &= dev_priv->vdc_irq_mask;
  193. spin_unlock(&dev_priv->irqmask_lock);
  194. if (dsp_int && gma_power_is_on(dev)) {
  195. psb_vdc_interrupt(dev, vdc_stat);
  196. handled = 1;
  197. }
  198. if (sgx_int) {
  199. /* Not expected - we have it masked, shut it up */
  200. u32 s, s2;
  201. s = PSB_RSGX32(PSB_CR_EVENT_STATUS);
  202. s2 = PSB_RSGX32(PSB_CR_EVENT_STATUS2);
  203. PSB_WSGX32(s, PSB_CR_EVENT_HOST_CLEAR);
  204. PSB_WSGX32(s2, PSB_CR_EVENT_HOST_CLEAR2);
  205. /* if s & _PSB_CE_TWOD_COMPLETE we have 2D done but
  206. we may as well poll even if we add that ! */
  207. handled = 1;
  208. }
  209. PSB_WVDC32(vdc_stat, PSB_INT_IDENTITY_R);
  210. (void) PSB_RVDC32(PSB_INT_IDENTITY_R);
  211. DRM_READMEMORYBARRIER();
  212. if (!handled)
  213. return IRQ_NONE;
  214. return IRQ_HANDLED;
  215. }
  216. void psb_irq_preinstall(struct drm_device *dev)
  217. {
  218. struct drm_psb_private *dev_priv =
  219. (struct drm_psb_private *) dev->dev_private;
  220. unsigned long irqflags;
  221. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  222. if (gma_power_is_on(dev))
  223. PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
  224. if (dev->vblank_enabled[0])
  225. dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEA_FLAG;
  226. if (dev->vblank_enabled[1])
  227. dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEB_FLAG;
  228. /* FIXME: Handle Medfield irq mask
  229. if (dev->vblank_enabled[1])
  230. dev_priv->vdc_irq_mask |= _MDFLD_PIPEB_EVENT_FLAG;
  231. if (dev->vblank_enabled[2])
  232. dev_priv->vdc_irq_mask |= _MDFLD_PIPEC_EVENT_FLAG;
  233. */
  234. /* This register is safe even if display island is off */
  235. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  236. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  237. }
  238. int psb_irq_postinstall(struct drm_device *dev)
  239. {
  240. struct drm_psb_private *dev_priv =
  241. (struct drm_psb_private *) dev->dev_private;
  242. unsigned long irqflags;
  243. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  244. /* This register is safe even if display island is off */
  245. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  246. PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
  247. if (dev->vblank_enabled[0])
  248. psb_enable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);
  249. else
  250. psb_disable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);
  251. if (dev->vblank_enabled[1])
  252. psb_enable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);
  253. else
  254. psb_disable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);
  255. if (dev->vblank_enabled[2])
  256. psb_enable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
  257. else
  258. psb_disable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
  259. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  260. return 0;
  261. }
  262. void psb_irq_uninstall(struct drm_device *dev)
  263. {
  264. struct drm_psb_private *dev_priv =
  265. (struct drm_psb_private *) dev->dev_private;
  266. unsigned long irqflags;
  267. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  268. PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
  269. if (dev->vblank_enabled[0])
  270. psb_disable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);
  271. if (dev->vblank_enabled[1])
  272. psb_disable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);
  273. if (dev->vblank_enabled[2])
  274. psb_disable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
  275. dev_priv->vdc_irq_mask &= _PSB_IRQ_SGX_FLAG |
  276. _PSB_IRQ_MSVDX_FLAG |
  277. _LNC_IRQ_TOPAZ_FLAG;
  278. /* These two registers are safe even if display island is off */
  279. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  280. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  281. wmb();
  282. /* This register is safe even if display island is off */
  283. PSB_WVDC32(PSB_RVDC32(PSB_INT_IDENTITY_R), PSB_INT_IDENTITY_R);
  284. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  285. }
  286. void psb_irq_turn_on_dpst(struct drm_device *dev)
  287. {
  288. struct drm_psb_private *dev_priv =
  289. (struct drm_psb_private *) dev->dev_private;
  290. u32 hist_reg;
  291. u32 pwm_reg;
  292. if (gma_power_begin(dev, false)) {
  293. PSB_WVDC32(1 << 31, HISTOGRAM_LOGIC_CONTROL);
  294. hist_reg = PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL);
  295. PSB_WVDC32(1 << 31, HISTOGRAM_INT_CONTROL);
  296. hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
  297. PSB_WVDC32(0x80010100, PWM_CONTROL_LOGIC);
  298. pwm_reg = PSB_RVDC32(PWM_CONTROL_LOGIC);
  299. PSB_WVDC32(pwm_reg | PWM_PHASEIN_ENABLE
  300. | PWM_PHASEIN_INT_ENABLE,
  301. PWM_CONTROL_LOGIC);
  302. pwm_reg = PSB_RVDC32(PWM_CONTROL_LOGIC);
  303. psb_enable_pipestat(dev_priv, 0, PIPE_DPST_EVENT_ENABLE);
  304. hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
  305. PSB_WVDC32(hist_reg | HISTOGRAM_INT_CTRL_CLEAR,
  306. HISTOGRAM_INT_CONTROL);
  307. pwm_reg = PSB_RVDC32(PWM_CONTROL_LOGIC);
  308. PSB_WVDC32(pwm_reg | 0x80010100 | PWM_PHASEIN_ENABLE,
  309. PWM_CONTROL_LOGIC);
  310. gma_power_end(dev);
  311. }
  312. }
  313. int psb_irq_enable_dpst(struct drm_device *dev)
  314. {
  315. struct drm_psb_private *dev_priv =
  316. (struct drm_psb_private *) dev->dev_private;
  317. unsigned long irqflags;
  318. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  319. /* enable DPST */
  320. mid_enable_pipe_event(dev_priv, 0);
  321. psb_irq_turn_on_dpst(dev);
  322. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  323. return 0;
  324. }
  325. void psb_irq_turn_off_dpst(struct drm_device *dev)
  326. {
  327. struct drm_psb_private *dev_priv =
  328. (struct drm_psb_private *) dev->dev_private;
  329. u32 hist_reg;
  330. u32 pwm_reg;
  331. if (gma_power_begin(dev, false)) {
  332. PSB_WVDC32(0x00000000, HISTOGRAM_INT_CONTROL);
  333. hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
  334. psb_disable_pipestat(dev_priv, 0, PIPE_DPST_EVENT_ENABLE);
  335. pwm_reg = PSB_RVDC32(PWM_CONTROL_LOGIC);
  336. PSB_WVDC32(pwm_reg & !(PWM_PHASEIN_INT_ENABLE),
  337. PWM_CONTROL_LOGIC);
  338. pwm_reg = PSB_RVDC32(PWM_CONTROL_LOGIC);
  339. gma_power_end(dev);
  340. }
  341. }
  342. int psb_irq_disable_dpst(struct drm_device *dev)
  343. {
  344. struct drm_psb_private *dev_priv =
  345. (struct drm_psb_private *) dev->dev_private;
  346. unsigned long irqflags;
  347. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  348. mid_disable_pipe_event(dev_priv, 0);
  349. psb_irq_turn_off_dpst(dev);
  350. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  351. return 0;
  352. }
  353. #ifdef PSB_FIXME
  354. static int psb_vblank_do_wait(struct drm_device *dev,
  355. unsigned int *sequence, atomic_t *counter)
  356. {
  357. unsigned int cur_vblank;
  358. int ret = 0;
  359. DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ,
  360. (((cur_vblank = atomic_read(counter))
  361. - *sequence) <= (1 << 23)));
  362. *sequence = cur_vblank;
  363. return ret;
  364. }
  365. #endif
  366. /*
  367. * It is used to enable VBLANK interrupt
  368. */
  369. int psb_enable_vblank(struct drm_device *dev, int pipe)
  370. {
  371. struct drm_psb_private *dev_priv = dev->dev_private;
  372. unsigned long irqflags;
  373. uint32_t reg_val = 0;
  374. uint32_t pipeconf_reg = mid_pipeconf(pipe);
  375. if (gma_power_begin(dev, false)) {
  376. reg_val = REG_READ(pipeconf_reg);
  377. gma_power_end(dev);
  378. }
  379. if (!(reg_val & PIPEACONF_ENABLE))
  380. return -EINVAL;
  381. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  382. if (pipe == 0)
  383. dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEA_FLAG;
  384. else if (pipe == 1)
  385. dev_priv->vdc_irq_mask |= _PSB_VSYNC_PIPEB_FLAG;
  386. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  387. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  388. psb_enable_pipestat(dev_priv, pipe, PIPE_VBLANK_INTERRUPT_ENABLE);
  389. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  390. return 0;
  391. }
  392. /*
  393. * It is used to disable VBLANK interrupt
  394. */
  395. void psb_disable_vblank(struct drm_device *dev, int pipe)
  396. {
  397. struct drm_psb_private *dev_priv = dev->dev_private;
  398. unsigned long irqflags;
  399. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  400. if (pipe == 0)
  401. dev_priv->vdc_irq_mask &= ~_PSB_VSYNC_PIPEA_FLAG;
  402. else if (pipe == 1)
  403. dev_priv->vdc_irq_mask &= ~_PSB_VSYNC_PIPEB_FLAG;
  404. PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
  405. PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
  406. psb_disable_pipestat(dev_priv, pipe, PIPE_VBLANK_INTERRUPT_ENABLE);
  407. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  408. }
  409. /* Called from drm generic code, passed a 'crtc', which
  410. * we use as a pipe index
  411. */
  412. u32 psb_get_vblank_counter(struct drm_device *dev, int pipe)
  413. {
  414. uint32_t high_frame = PIPEAFRAMEHIGH;
  415. uint32_t low_frame = PIPEAFRAMEPIXEL;
  416. uint32_t pipeconf_reg = PIPEACONF;
  417. uint32_t reg_val = 0;
  418. uint32_t high1 = 0, high2 = 0, low = 0, count = 0;
  419. switch (pipe) {
  420. case 0:
  421. break;
  422. case 1:
  423. high_frame = PIPEBFRAMEHIGH;
  424. low_frame = PIPEBFRAMEPIXEL;
  425. pipeconf_reg = PIPEBCONF;
  426. break;
  427. case 2:
  428. high_frame = PIPECFRAMEHIGH;
  429. low_frame = PIPECFRAMEPIXEL;
  430. pipeconf_reg = PIPECCONF;
  431. break;
  432. default:
  433. dev_err(dev->dev, "%s, invalid pipe.\n", __func__);
  434. return 0;
  435. }
  436. if (!gma_power_begin(dev, false))
  437. return 0;
  438. reg_val = REG_READ(pipeconf_reg);
  439. if (!(reg_val & PIPEACONF_ENABLE)) {
  440. dev_err(dev->dev, "trying to get vblank count for disabled pipe %d\n",
  441. pipe);
  442. goto psb_get_vblank_counter_exit;
  443. }
  444. /*
  445. * High & low register fields aren't synchronized, so make sure
  446. * we get a low value that's stable across two reads of the high
  447. * register.
  448. */
  449. do {
  450. high1 = ((REG_READ(high_frame) & PIPE_FRAME_HIGH_MASK) >>
  451. PIPE_FRAME_HIGH_SHIFT);
  452. low = ((REG_READ(low_frame) & PIPE_FRAME_LOW_MASK) >>
  453. PIPE_FRAME_LOW_SHIFT);
  454. high2 = ((REG_READ(high_frame) & PIPE_FRAME_HIGH_MASK) >>
  455. PIPE_FRAME_HIGH_SHIFT);
  456. } while (high1 != high2);
  457. count = (high1 << 8) | low;
  458. psb_get_vblank_counter_exit:
  459. gma_power_end(dev);
  460. return count;
  461. }