1fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt/* 2fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Copyright 2013 Joakim Sindholt <opensource@zhasha.com> 3fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 4fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Permission is hereby granted, free of charge, to any person obtaining a 5fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * copy of this software and associated documentation files (the "Software"), 6fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * to deal in the Software without restriction, including without limitation 7fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * on the rights to use, copy, modify, merge, publish, distribute, sub 8fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * license, and/or sell copies of the Software, and to permit persons to whom 9fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * the Software is furnished to do so, subject to the following conditions: 10fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 11fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * The above copyright notice and this permission notice (including the next 12fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * paragraph) shall be included in all copies or substantial portions of the 13fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Software. 14fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 15fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 22fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 23fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include <string.h> 24fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 25fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include "util/u_memory.h" 26fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 27fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include "d3dadapter/drm.h" 28fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtextern const struct D3DAdapter9DRM drm9_desc; 29fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 30fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct { 31fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt const char *name; 32fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt const void *desc; 33fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt} drivers[] = { 34fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt { D3DADAPTER9DRM_NAME, &drm9_desc }, 35fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt}; 36fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 37fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtPUBLIC const void * WINAPI 38fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtD3DAdapter9GetProc( const char *name ) 39fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt{ 40fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt int i; 4147b390fe45e5e6f982c60b58985892438959cd8eJan Vesely for (i = 0; i < ARRAY_SIZE(drivers); ++i) { 42fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt if (strcmp(name, drivers[i].name) == 0) { 43fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt return drivers[i].desc; 44fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt } 45fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt } 46fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt return NULL; 47fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt} 48