<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:10.5pt;">
<div align="left" style="text-align:justify;">Hi, All</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">Please help review the patch.</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">Thanks</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">Background:</div>
<div align="left" style="text-align:justify;">If we use ‘pkill -9 weston’, when restart weston, weston could not get the active encoder attached on connector and exit abnormally. </div>
<div align="left" style="text-align:justify;">This is because when weston is pkilled, drm cleanups the encoders attached to active connector in KMS. </div>
<div align="left" style="text-align:justify;">This patch will ignore the active encode checking, weston has the ability to re-initialize encoder and reattached it into connector.</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;">===</div>
<div align="left" style="text-align:justify;">commit 7f991195c20d9dd57e14faf88cd36db0c77df424</div>
<div align="left" style="text-align:justify;">Author: Wang Quanxian <quanxian.wang@intel.com></div>
<div align="left" style="text-align:justify;">Date: Thu Jul 19 19:11:04 2012 +0800</div>
<div align="left" style="text-align:justify;"> User sends SIGKILL to weston, KMS will clean up encoder</div>
<div align="left" style="text-align:justify;"> attached with connector. When weston restarts again, it causes</div>
<div align="left" style="text-align:justify;"> exit of weston because no active encoder is attached to connector.</div>
<div align="left" style="text-align:justify;"> This patch will ignore the checking and weston will initialize </div>
<div align="left" style="text-align:justify;"> encoder again and re-attach it to connector in the following process.</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;"> Sign-Off-By Quanxian Wang <quanxian.wang@intel.com></div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">diff --git a/src/compositor-drm.c b/src/compositor-drm.c</div>
<div align="left" style="text-align:justify;">index 47cd512..bb1b138 100644</div>
<div align="left" style="text-align:justify;">--- a/src/compositor-drm.c</div>
<div align="left" style="text-align:justify;">+++ b/src/compositor-drm.c</div>
<div align="left" style="text-align:justify;">@@ -1348,26 +1348,28 @@ create_output_for_connector(struct drm_compositor *ec,</div>
<div align="left" style="text-align:justify;"> /* Get the current mode on the crtc that's currently driving</div>
<div align="left" style="text-align:justify;"> * this connector. */</div>
<div align="left" style="text-align:justify;"> encoder = drmModeGetEncoder(ec->drm.fd, connector->encoder_id);</div>
<div align="left" style="text-align:justify;">- if (encoder == NULL)</div>
<div align="left" style="text-align:justify;">- goto err_free;</div>
<div align="left" style="text-align:justify;">- crtc = drmModeGetCrtc(ec->drm.fd, encoder->crtc_id);</div>
<div align="left" style="text-align:justify;">- drmModeFreeEncoder(encoder);</div>
<div align="left" style="text-align:justify;">- if (crtc == NULL)</div>
<div align="left" style="text-align:justify;">- goto err_free;</div>
<div align="left" style="text-align:justify;">-</div>
<div align="left" style="text-align:justify;">- /* if don't get mode from drm driver, use default 800x480 */</div>
<div align="left" style="text-align:justify;">- if (crtc->mode.clock != 0)</div>
<div align="left" style="text-align:justify;">- {</div>
<div align="left" style="text-align:justify;">+ if (encoder != NULL)</div>
<div align="left" style="text-align:justify;">+ {</div>
<div align="left" style="text-align:justify;">+ crtc = drmModeGetCrtc(ec->drm.fd, encoder->crtc_id);</div>
<div align="left" style="text-align:justify;">+ drmModeFreeEncoder(encoder);</div>
<div align="left" style="text-align:justify;">+ if (crtc == NULL)</div>
<div align="left" style="text-align:justify;">+ goto err_free;</div>
<div align="left" style="text-align:justify;"> crtc_mode = crtc->mode;</div>
<div align="left" style="text-align:justify;">- } else {</div>
<div align="left" style="text-align:justify;">+ drmModeFreeCrtc(crtc);</div>
<div align="left" style="text-align:justify;">+ }</div>
<div align="left" style="text-align:justify;">+ /*</div>
<div align="left" style="text-align:justify;">+ * No actiave encoder is connected with the connector</div>
<div align="left" style="text-align:justify;">+ * If connector has no mode available, takes detault mode</div>
<div align="left" style="text-align:justify;">+ * Or takes the first mode from connector</div>
<div align="left" style="text-align:justify;">+ */</div>
<div align="left" style="text-align:justify;">+ if (encoder == NULL || crtc_mode.clock == 0)</div>
<div align="left" style="text-align:justify;">+ {</div>
<div align="left" style="text-align:justify;"> if (connector->count_modes == 0)</div>
<div align="left" style="text-align:justify;"> crtc_mode = builtin_800x480;</div>
<div align="left" style="text-align:justify;"> else</div>
<div align="left" style="text-align:justify;"> crtc_mode = connector->modes[0];</div>
<div align="left" style="text-align:justify;"> }</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">- drmModeFreeCrtc(crtc);</div>
<div align="left" style="text-align:justify;">-</div>
<div align="left" style="text-align:justify;"> if (connector->count_modes == 0) {</div>
<div align="left" style="text-align:justify;"> ret = drm_output_add_mode(output, &crtc_mode);</div>
<div align="left" style="text-align:justify;"> if (ret)</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;">Thanks</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">Quanxian Wang</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
</span></font>
</body>
</html>