static void dpst_restore_bl_adj_factor(struct drm_device *dev)
{
    struct drm_psb_private *dev_priv = dev->dev_private;

    if (!dev_priv)
	return;

    if (blc_adj2 != dev_priv->blc_adj2 && blc_adj2 != 0)
        psb_dpst_bl(dev, &blc_adj2);
}
static void dpst_restore_bl_adj_factor(struct drm_device *dev)
{
	struct drm_psb_private *dev_priv = dev->dev_private;
	int i = 0;

	if (!dev_priv)
		return;

	/*compute the original adj in function psb_dpst_bl*/
	dev_priv->blc_adj2 = ((dev_priv->blc_adj2 * 100) / 255) *100 /255;

	if (blc_adj2 != dev_priv->blc_adj2 && blc_adj2 != 0)
	{
		for(i = dev_priv->blc_adj2; i <= blc_adj2; i = i+30)
		{
			psb_dpst_bl(dev, &i);
			msleep(100);
		}
		i = blc_adj2;
		psb_dpst_bl(dev, &i);
	}
}
 void dpst_execute_recv_command(struct dispmgr_command_hdr *cmd_hdr)
{
	switch (cmd_hdr->cmd) {
	case DISPMGR_DPST_GET_MODE:
		 {
			if (cmd_hdr->data_size) {
				unsigned long value =
				    *((unsigned long *)cmd_hdr->data);
			}
			uint32_t xy = 0;
			struct dispmgr_command_hdr send_cmd_hdr;
			psb_dpst_mode(g_dev, &xy);
			send_cmd_hdr.data_size = sizeof(xy);
			send_cmd_hdr.data = &xy;
			send_cmd_hdr.module = DISPMGR_MOD_DPST;
			send_cmd_hdr.cmd = DISPMGR_DPST_GET_MODE;
			dispmgr_nl_send_msg(&send_cmd_hdr);
		}
		break;
	case DISPMGR_DPST_INIT_COMM:
		 {
			if (cmd_hdr->data_size) {
				unsigned long value =
				    *((unsigned long *)cmd_hdr->data);
				uint32_t enable = value;
				psb_init_comm(g_dev, &enable);
			}
		} break;
	case DISPMGR_DPST_UPDATE_GUARD:
		 {
			if (cmd_hdr->data_size) {
				unsigned long value =
				    *((unsigned long *)cmd_hdr->data);
				uint32_t gb_arg = value;
				psb_update_guard(g_dev, &gb_arg);
			}
		} break;
	case DISPMGR_DPST_BL_CMD:
		 {
			if (cmd_hdr->data_size) {
				unsigned long value =
				    *((unsigned long *)cmd_hdr->data);
				uint32_t data = value;
				psb_dpst_bl(g_dev, (void *)&data);
			}
		} break;
	case DISPMGR_DPST_HIST_ENABLE:
		 {
			if (cmd_hdr->data_size) {
				unsigned long value =
				    *((unsigned long *)cmd_hdr->data);
				uint32_t enable = value;
				psb_hist_enable(g_dev, &enable);
			}
		} break;
	case DISPMGR_DPST_GAMMA_SET_CMD:
		 {
			if (cmd_hdr->data_size) {
				uint16_t * arg = (uint16_t *) cmd_hdr->data;
				psb_gamma_set(g_dev, (void *)arg);
			}
		} break;
	case DISPMGR_DPST_DIET_ENABLE:
		 {
			if (cmd_hdr->data_size) {
				uint32_t * arg = (uint32_t *) cmd_hdr->data;
				//psb_diet_enable(g_dev, (void *)arg);
			}
		} break;
	case DISPMGR_DPST_DIET_DISABLE:
		 {
			//psb_diet_enable(g_dev, 0);
		}
		break;
	default:
		 {
			printk
			    ("kdispmgr: received unknown dpst command = %d.\n",
			     cmd_hdr->cmd);
		};
	};			/* switch */
}