int send_hist(void)
{
	struct dispmgr_command_hdr dispmgr_cmd;
	struct drm_psb_hist_status_arg mydata;

	/* before we send get the status for run_algorithm */
	dpst_histogram_get_status(g_dev, &mydata);
	dispmgr_cmd.module = DISPMGR_MOD_DPST;
	dispmgr_cmd.cmd = DISPMGR_DPST_HIST_DATA;
	dispmgr_cmd.data_size = sizeof(struct drm_psb_hist_status_arg);
	dispmgr_cmd.data = &mydata;
	dispmgr_nl_send_msg(&dispmgr_cmd);
	return 0;
}
 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 */
}
Beispiel #3
0
static void execute_recv_command(struct dispmgr_command_hdr *cmd_hdr)
{
	switch (cmd_hdr->module) {
	case DISPMGR_MOD_NETLINK:
		{
			switch (cmd_hdr->cmd) {
			case DISPMGR_TEST:
				{
					struct dispmgr_command_hdr send_cmd_hdr;
					unsigned long data = 0xdeadbeef;
					if (cmd_hdr->data_size) {
						unsigned long value =
						    *((unsigned long *)
						      cmd_hdr->data);
						printk
						("kdispmgr: received DISPMGR_"
						"TEST cmd data = 0x%lx.\n",
						value);
					} else {
						printk
						("kdispmgr: received DISPMGR_"
						"TEST cmd NO data.\n");
					}

					send_cmd_hdr.data_size = sizeof(data);
					send_cmd_hdr.data = &data;
					send_cmd_hdr.module =
					    DISPMGR_MOD_NETLINK;
					send_cmd_hdr.cmd = DISPMGR_TEST;
					dispmgr_nl_send_msg(&send_cmd_hdr);
				}
				break;
			case DISPMGR_TEST_TEXT:
				{
					struct dispmgr_command_hdr send_cmd_hdr;
					char *data = "can you hear me?";
					if (cmd_hdr->data_size) {
						printk
						("kdispmgr: received DISPMGR_"
						"TEST_TEXT cmd text = 0x%s.\n",
						(char *)cmd_hdr->data);
					} else {
						printk
						("kdispmgr: received DISPMGR_"
						"TEST_TEXT cmd NO text.\n");
					}
					send_cmd_hdr.module =
					    DISPMGR_MOD_NETLINK;
					send_cmd_hdr.cmd = DISPMGR_TEST_TEXT;
					send_cmd_hdr.data_size =
					    strlen(data) + 1;
					send_cmd_hdr.data = (void *)data;
					dispmgr_nl_send_msg(&send_cmd_hdr);
				}
				break;
			default:
				{
					printk
					("kdispmgr: received unknown "
					"command = %d.\n",
					cmd_hdr->cmd);
				};
			};	/* switch */
		}
		break;
	case DISPMGR_MOD_DPST:
		{
			dpst_execute_recv_command(cmd_hdr);
		}
		break;
	default:
		{
			printk
			("kdispmgr: received unknown "
			"module = %d.\n", cmd_hdr->module);
		};
	}			/* switch */
}